Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Fix a crash on IE/Safari when plugin is not installed

paweldomas34a24ce290ce
diff --git a/modules/UI/side_pannels/settings/SettingsMenu.js b/modules/UI/side_pannels/settings/SettingsMenu.js
index a97e41ae44..271b942fec 100644
--- a/modules/UI/side_pannels/settings/SettingsMenu.js
+++ b/modules/UI/side_pannels/settings/SettingsMenu.js
@@ -137,30 +137,37 @@ export default {
// DEVICES LIST
- if (JitsiMeetJS.mediaDevices.isDeviceListAvailable() &&
- JitsiMeetJS.mediaDevices.isDeviceChangeAvailable()) {
- this.changeDevicesList([]);
-
- $('#selectCamera').change(function () {
- let cameraDeviceId = $(this).val();
- if (cameraDeviceId !== Settings.getCameraDeviceId()) {
- emitter.emit(UIEvents.VIDEO_DEVICE_CHANGED, cameraDeviceId);
+ JitsiMeetJS.mediaDevices.isDeviceListAvailable()
+ .then((isDeviceListAvailable) => {
+ if (isDeviceListAvailable &&
+ JitsiMeetJS.mediaDevices.isDeviceChangeAvailable()) {
+ this._initializeDeviceSelectionSettings(emitter);
}
});
- $('#selectMic').change(function () {
- let micDeviceId = $(this).val();
- if (micDeviceId !== Settings.getMicDeviceId()) {
- emitter.emit(UIEvents.AUDIO_DEVICE_CHANGED, micDeviceId);
- }
- });
- $('#selectAudioOutput').change(function () {
- let audioOutputDeviceId = $(this).val();
- if (audioOutputDeviceId !== Settings.getAudioOutputDeviceId()) {
- emitter.emit(UIEvents.AUDIO_OUTPUT_DEVICE_CHANGED,
- audioOutputDeviceId);
- }
- });
- }
+ },
+
+ _initializeDeviceSelectionSettings(emitter) {
+ this.changeDevicesList([]);
+
+ $('#selectCamera').change(function () {
+ let cameraDeviceId = $(this).val();
+ if (cameraDeviceId !== Settings.getCameraDeviceId()) {
+ emitter.emit(UIEvents.VIDEO_DEVICE_CHANGED, cameraDeviceId);
+ }
+ });
+ $('#selectMic').change(function () {
+ let micDeviceId = $(this).val();
+ if (micDeviceId !== Settings.getMicDeviceId()) {
+ emitter.emit(UIEvents.AUDIO_DEVICE_CHANGED, micDeviceId);
+ }
+ });
+ $('#selectAudioOutput').change(function () {
+ let audioOutputDeviceId = $(this).val();
+ if (audioOutputDeviceId !== Settings.getAudioOutputDeviceId()) {
+ emitter.emit(
+ UIEvents.AUDIO_OUTPUT_DEVICE_CHANGED, audioOutputDeviceId);
+ }
+ });
},
/**