|
@@ -27,23 +27,28 @@ import {
|
27
|
27
|
*
|
28
|
28
|
* @param {(Function|Object)} stateful -The (whole) redux state, or redux's
|
29
|
29
|
* {@code getState} function to be used to retrieve the state.
|
|
30
|
+ * @param {boolean} isDisplayedOnWelcomePage - Indicates whether the device selection dialog is displayed on the
|
|
31
|
+ * welcome page or not.
|
30
|
32
|
* @returns {Object} - The properties for the device selection dialog.
|
31
|
33
|
*/
|
32
|
|
-export function getDeviceSelectionDialogProps(stateful: Object | Function) {
|
|
34
|
+export function getDeviceSelectionDialogProps(stateful: Object | Function, isDisplayedOnWelcomePage) {
|
33
|
35
|
// On mobile Safari because of https://bugs.webkit.org/show_bug.cgi?id=179363#c30, the old track is stopped
|
34
|
36
|
// by the browser when a new track is created for preview. That's why we are disabling all previews.
|
35
|
37
|
const disablePreviews = isIosMobileBrowser();
|
36
|
38
|
|
37
|
39
|
const state = toState(stateful);
|
38
|
40
|
const settings = state['features/base/settings'];
|
39
|
|
- const { conference } = state['features/base/conference'];
|
40
|
41
|
const { permissions } = state['features/base/devices'];
|
41
|
|
- const cameraChangeSupported = JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('input');
|
|
42
|
+ const inputDeviceChangeSupported = JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('input');
|
42
|
43
|
const speakerChangeSupported = JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('output');
|
43
|
44
|
const userSelectedCamera = getUserSelectedCameraDeviceId(state);
|
44
|
45
|
const userSelectedMic = getUserSelectedMicDeviceId(state);
|
45
|
|
- let disableAudioInputChange = !JitsiMeetJS.mediaDevices.isMultipleAudioInputSupported();
|
46
|
|
- let disableVideoInputSelect = !cameraChangeSupported;
|
|
46
|
+
|
|
47
|
+ // When the previews are disabled we don't need multiple audio input support in order to chage the mic. This is the
|
|
48
|
+ // case for Safari on iOS.
|
|
49
|
+ let disableAudioInputChange
|
|
50
|
+ = !JitsiMeetJS.mediaDevices.isMultipleAudioInputSupported() && !(disablePreviews && inputDeviceChangeSupported);
|
|
51
|
+ let disableVideoInputSelect = !inputDeviceChangeSupported;
|
47
|
52
|
let selectedAudioInputId = settings.micDeviceId;
|
48
|
53
|
let selectedAudioOutputId = getAudioOutputDeviceId();
|
49
|
54
|
let selectedVideoInputId = settings.cameraDeviceId;
|
|
@@ -52,7 +57,7 @@ export function getDeviceSelectionDialogProps(stateful: Object | Function) {
|
52
|
57
|
// conference and this is not supported, when we open device selection on
|
53
|
58
|
// welcome page changing input devices will not be a problem
|
54
|
59
|
// on welcome page we also show only what we have saved as user selected devices
|
55
|
|
- if (!conference) {
|
|
60
|
+ if (isDisplayedOnWelcomePage) {
|
56
|
61
|
disableAudioInputChange = false;
|
57
|
62
|
disableVideoInputSelect = false;
|
58
|
63
|
selectedAudioInputId = userSelectedMic;
|
|
@@ -72,7 +77,7 @@ export function getDeviceSelectionDialogProps(stateful: Object | Function) {
|
72
|
77
|
hideAudioInputPreview: disableAudioInputChange || !JitsiMeetJS.isCollectingLocalStats() || disablePreviews,
|
73
|
78
|
hideAudioOutputPreview: !speakerChangeSupported || disablePreviews,
|
74
|
79
|
hideAudioOutputSelect: !speakerChangeSupported,
|
75
|
|
- hideVideoInputPreview: !cameraChangeSupported || disablePreviews,
|
|
80
|
+ hideVideoInputPreview: !inputDeviceChangeSupported || disablePreviews,
|
76
|
81
|
selectedAudioInputId,
|
77
|
82
|
selectedAudioOutputId,
|
78
|
83
|
selectedVideoInputId
|