Device selection has live previews that reuse the current local audio and video tracks for the sake of internet explorer. This means when the local video was muted, device selection would show a muted message. It is preferred to show a live preview even when muted. The changes include: - Passing device ids into DeviceSelectionDialog, not tracks. - Setting default selected devices to use for live previews. - Removing all checks in DeviceSelectionDialog involving local tracks. - Catching and displaying errors when creating a live video preview.
38 lines
1.5 KiB
JavaScript
38 lines
1.5 KiB
JavaScript
/* globals APP */
|
|
|
|
import { openDialog } from '../base/dialog';
|
|
import JitsiMeetJS from '../base/lib-jitsi-meet';
|
|
|
|
import { DeviceSelectionDialog } from './components';
|
|
|
|
/**
|
|
* Open DeviceSelectionDialog with a configuration based on the environment's
|
|
* supported abilities.
|
|
*
|
|
* @returns {Function}
|
|
*/
|
|
export function openDeviceSelectionDialog() {
|
|
return dispatch => {
|
|
JitsiMeetJS.mediaDevices.isDeviceListAvailable()
|
|
.then(isDeviceListAvailable => {
|
|
dispatch(openDialog(DeviceSelectionDialog, {
|
|
currentAudioInputId: APP.settings.getMicDeviceId(),
|
|
currentAudioOutputId: APP.settings.getAudioOutputDeviceId(),
|
|
currentVideoInputId: APP.settings.getCameraDeviceId(),
|
|
disableAudioInputChange:
|
|
!JitsiMeetJS.isMultipleAudioInputSupported(),
|
|
disableDeviceChange: !isDeviceListAvailable
|
|
|| !JitsiMeetJS.mediaDevices.isDeviceChangeAvailable(),
|
|
hasAudioPermission: JitsiMeetJS.mediaDevices
|
|
.isDevicePermissionGranted('audio'),
|
|
hasVideoPermission: JitsiMeetJS.mediaDevices
|
|
.isDevicePermissionGranted('video'),
|
|
hideAudioInputPreview:
|
|
!JitsiMeetJS.isCollectingLocalStats(),
|
|
hideAudioOutputSelect: !JitsiMeetJS.mediaDevices
|
|
.isDeviceChangeAvailable('output')
|
|
}));
|
|
});
|
|
};
|
|
}
|