|
|
@@ -33,7 +33,10 @@ import { updateDeviceList } from './react/features/base/devices';
|
|
33
|
33
|
import {
|
|
34
|
34
|
isFatalJitsiConnectionError
|
|
35
|
35
|
} from './react/features/base/lib-jitsi-meet';
|
|
36
|
|
-import { setVideoAvailable } from './react/features/base/media';
|
|
|
36
|
+import {
|
|
|
37
|
+ setAudioAvailable,
|
|
|
38
|
+ setVideoAvailable
|
|
|
39
|
+} from './react/features/base/media';
|
|
37
|
40
|
import {
|
|
38
|
41
|
localParticipantConnectionStatusChanged,
|
|
39
|
42
|
localParticipantRoleChanged,
|
|
|
@@ -671,24 +674,17 @@ export default {
|
|
671
|
674
|
}
|
|
672
|
675
|
|
|
673
|
676
|
// if user didn't give access to mic or camera or doesn't have
|
|
674
|
|
- // them at all, we disable corresponding toolbar buttons
|
|
|
677
|
+ // them at all, we mark corresponding toolbar buttons as muted,
|
|
|
678
|
+ // so that the user can try unmute later on and add audio/video
|
|
|
679
|
+ // to the conference
|
|
675
|
680
|
if (!tracks.find((t) => t.isAudioTrack())) {
|
|
676
|
|
- APP.UI.setMicrophoneButtonEnabled(false);
|
|
|
681
|
+ this.audioMuted = true;
|
|
|
682
|
+ APP.UI.setAudioMuted(this.getMyUserId(), this.audioMuted);
|
|
677
|
683
|
}
|
|
678
|
684
|
|
|
679
|
685
|
if (!tracks.find((t) => t.isVideoTrack())) {
|
|
680
|
|
- // Instead of disabling the button we want to show button
|
|
681
|
|
- // muted, so that the user can have the opportunity to add
|
|
682
|
|
- // the video later on, even if joined without it.
|
|
683
|
686
|
this.videoMuted = true;
|
|
684
|
687
|
APP.UI.setVideoMuted(this.getMyUserId(), this.videoMuted);
|
|
685
|
|
- // FIXME this is a workaround for the situation where
|
|
686
|
|
- // both audio and video permissions are rejected initially
|
|
687
|
|
- // and the callback from _initDeviceList will never be
|
|
688
|
|
- // executed (GUM not initialized - check lib-jitsi-meet).
|
|
689
|
|
- // The goal here is to disable the video icon in case no
|
|
690
|
|
- // video permissions were granted.
|
|
691
|
|
- this.updateVideoIconEnabled();
|
|
692
|
688
|
}
|
|
693
|
689
|
|
|
694
|
690
|
this._initDeviceList();
|
|
|
@@ -1156,7 +1152,6 @@ export default {
|
|
1156
|
1152
|
this.isSharingScreen = false;
|
|
1157
|
1153
|
}
|
|
1158
|
1154
|
APP.UI.setVideoMuted(this.getMyUserId(), this.videoMuted);
|
|
1159
|
|
- this.updateVideoIconEnabled();
|
|
1160
|
1155
|
APP.UI.updateDesktopSharingButtons();
|
|
1161
|
1156
|
});
|
|
1162
|
1157
|
},
|
|
|
@@ -1178,7 +1173,6 @@ export default {
|
|
1178
|
1173
|
} else {
|
|
1179
|
1174
|
this.audioMuted = false;
|
|
1180
|
1175
|
}
|
|
1181
|
|
- APP.UI.setMicrophoneButtonEnabled(true);
|
|
1182
|
1176
|
APP.UI.setAudioMuted(this.getMyUserId(), this.audioMuted);
|
|
1183
|
1177
|
});
|
|
1184
|
1178
|
},
|
|
|
@@ -1799,7 +1793,19 @@ export default {
|
|
1799
|
1793
|
APP.UI.updateDTMFSupport(isDTMFSupported);
|
|
1800
|
1794
|
});
|
|
1801
|
1795
|
|
|
1802
|
|
- APP.UI.addListener(UIEvents.AUDIO_MUTED, muteLocalAudio);
|
|
|
1796
|
+ APP.UI.addListener(UIEvents.AUDIO_MUTED, muted => {
|
|
|
1797
|
+ if (!localAudio && this.audioMuted && !muted) {
|
|
|
1798
|
+ createLocalTracks({ devices: ['audio'] }, false)
|
|
|
1799
|
+ .then(([audioTrack]) => {
|
|
|
1800
|
+ this.useAudioStream(audioTrack);
|
|
|
1801
|
+ })
|
|
|
1802
|
+ .catch(error => {
|
|
|
1803
|
+ APP.UI.showDeviceErrorDialog(error, null);
|
|
|
1804
|
+ });
|
|
|
1805
|
+ } else {
|
|
|
1806
|
+ muteLocalAudio(muted);
|
|
|
1807
|
+ }
|
|
|
1808
|
+ });
|
|
1803
|
1809
|
APP.UI.addListener(UIEvents.VIDEO_MUTED, muted => {
|
|
1804
|
1810
|
if (this.isAudioOnly() && !muted) {
|
|
1805
|
1811
|
this._displayAudioOnlyTooltip('videoMute');
|
|
|
@@ -2139,7 +2145,6 @@ export default {
|
|
2139
|
2145
|
mediaDeviceHelper.setCurrentMediaDevices(devices);
|
|
2140
|
2146
|
APP.UI.onAvailableDevicesChanged(devices);
|
|
2141
|
2147
|
APP.store.dispatch(updateDeviceList(devices));
|
|
2142
|
|
- this.updateVideoIconEnabled();
|
|
2143
|
2148
|
});
|
|
2144
|
2149
|
|
|
2145
|
2150
|
this.deviceChangeListener = (devices) =>
|
|
|
@@ -2221,9 +2226,31 @@ export default {
|
|
2221
|
2226
|
.then(() => {
|
|
2222
|
2227
|
mediaDeviceHelper.setCurrentMediaDevices(devices);
|
|
2223
|
2228
|
APP.UI.onAvailableDevicesChanged(devices);
|
|
2224
|
|
- this.updateVideoIconEnabled();
|
|
2225
|
2229
|
});
|
|
2226
|
2230
|
},
|
|
|
2231
|
+
|
|
|
2232
|
+ /**
|
|
|
2233
|
+ * Determines whether or not the audio button should be enabled.
|
|
|
2234
|
+ */
|
|
|
2235
|
+ updateAudioIconEnabled() {
|
|
|
2236
|
+ const audioMediaDevices
|
|
|
2237
|
+ = mediaDeviceHelper.getCurrentMediaDevices().audioinput;
|
|
|
2238
|
+ const audioDeviceCount
|
|
|
2239
|
+ = audioMediaDevices ? audioMediaDevices.length : 0;
|
|
|
2240
|
+
|
|
|
2241
|
+ // The audio functionality is considered available if there are any
|
|
|
2242
|
+ // audio devices detected or if the local audio stream already exists.
|
|
|
2243
|
+ const available = audioDeviceCount > 0 || Boolean(localAudio);
|
|
|
2244
|
+
|
|
|
2245
|
+ logger.debug(
|
|
|
2246
|
+ 'Microphone button enabled: ' + available,
|
|
|
2247
|
+ 'local audio: ' + localAudio,
|
|
|
2248
|
+ 'audio devices: ' + audioMediaDevices,
|
|
|
2249
|
+ 'device count: ' + audioDeviceCount);
|
|
|
2250
|
+
|
|
|
2251
|
+ APP.store.dispatch(setAudioAvailable(available));
|
|
|
2252
|
+ },
|
|
|
2253
|
+
|
|
2227
|
2254
|
/**
|
|
2228
|
2255
|
* Determines whether or not the video button should be enabled.
|
|
2229
|
2256
|
*/
|