Skip to content

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

Merge remote-tracking branch 'remotes/upstream/master' into gum_permission_dialog_guidance

tsaregf03b228eea4c
diff --cc conference.js
index 70da1dc492,b6ab6945b6..bc8e243e94
--- a/conference.js
+++ b/conference.js
@@@ -488,38 -432,65 +493,35 @@@ export default
};
}
- let audioAndVideoError, audioOnlyError;
-
- return JitsiMeetJS.init(config).then(() => {
- return Promise.all([
- // try to retrieve audio and video
- createLocalTracks(['audio', 'video'])
- // if failed then try to retrieve only audio
- .catch(err => {
- audioAndVideoError = err;
- return createLocalTracks(['audio']);
- })
- // if audio also failed then just return empty array
- .catch(err => {
- audioOnlyError = err;
- return [];
- }),
- connect(options.roomName)
- ]);
- }).then(([tracks, con]) => {
- if (audioAndVideoError) {
- if (audioOnlyError) {
- // If both requests for 'audio' + 'video' and 'audio' only
- // failed, we assume that there is some problems with user's
- // microphone and show corresponding dialog.
- APP.UI.showDeviceErrorDialog(audioOnlyError, null);
- } else {
- // If request for 'audio' + 'video' failed, but request for
- // 'audio' only was OK, we assume that we had problems with
- // camera and show corresponding dialog.
- APP.UI.showDeviceErrorDialog(null, audioAndVideoError);
+ return JitsiMeetJS.init(config)
+ .then(() => createInitialLocalTracksAndConnect(options.roomName))
+ .then(([tracks, con]) => {
+ console.log('initialized with %s local tracks', tracks.length);
+ APP.connection = connection = con;
+ this._createRoom(tracks);
+ this.isDesktopSharingEnabled =
+ JitsiMeetJS.isDesktopSharingEnabled();
- if(this.isDesktopSharingEnabled)
- APP.API.addPostisMessageListener('toggle-share-screen',
- () => this.toggleScreenSharing());
+
+ // if user didn't give access to mic or camera or doesn't have
+ // them at all, we disable corresponding toolbar buttons
+ if (!tracks.find((t) => t.isAudioTrack())) {
+ APP.UI.disableMicrophoneButton();
}
- }
-
- console.log('initialized with %s local tracks', tracks.length);
- APP.connection = connection = con;
- this._createRoom(tracks);
- this.isDesktopSharingEnabled =
- JitsiMeetJS.isDesktopSharingEnabled();
- // if user didn't give access to mic or camera or doesn't have
- // them at all, we disable corresponding toolbar buttons
- if (!tracks.find((t) => t.isAudioTrack())) {
- APP.UI.disableMicrophoneButton();
- }
-
- if (!tracks.find((t) => t.isVideoTrack())) {
- APP.UI.disableCameraButton();
- }
+ if (!tracks.find((t) => t.isVideoTrack())) {
+ APP.UI.disableCameraButton();
+ }
- this._initDeviceList();
+ this._initDeviceList();
- if (config.iAmRecorder)
- this.recorder = new Recorder();
+ if (config.iAmRecorder)
+ this.recorder = new Recorder();
- // XXX The API will take care of disconnecting from the XMPP server
- // (and, thus, leaving the room) on unload.
- return new Promise((resolve, reject) => {
- (new ConferenceConnector(resolve, reject)).connect();
- });
+ // XXX The API will take care of disconnecting from the XMPP
+ // server (and, thus, leaving the room) on unload.
+ return new Promise((resolve, reject) => {
+ (new ConferenceConnector(resolve, reject)).connect();
+ });
});
},
/**
diff --cc modules/UI/UI.js
index 2eb8f97f71,6fc5815839..ed67a6e96c
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@@ -1386,24 -1415,8 +1416,24 @@@ UI.hideRingOverLay = function ()
FilmStrip.toggleFilmStrip(true);
};
+/**
+ * Shows browser-specific overlay with guidance how to proceed with gUM prompt.
+ * @param {string} browser - name of browser for which to show the guidance
+ * overlay.
+ */
+UI.showUserMediaPermissionsGuidanceOverlay = function (browser) {
+ GumPermissionsOverlay.show(browser);
+};
+
+/**
+ * Hides browser-specific overlay with guidance how to proceed with gUM prompt.
+ */
+UI.hideUserMediaPermissionsGuidanceOverlay = function () {
+ GumPermissionsOverlay.hide();
+};
+
/**
- * Shows or hides the keyboard shortcuts panel.'
+ * Shows or hides the keyboard shortcuts panel, depending on the current state.'
*/
UI.toggleKeyboardShortcutsPanel = function() {
$('#keyboard-shortcuts').toggle();
diff --cc modules/devices/mediaDeviceHelper.js
index c4e1953ecb,8043c93546..3392fe0975
--- a/modules/devices/mediaDeviceHelper.js
+++ b/modules/devices/mediaDeviceHelper.js
@@@ -191,15 -191,14 +191,17 @@@ export default
if (audioRequested && videoRequested) {
// First we try to create both audio and video tracks together.
- return createLocalTracks(
- ['audio', 'video'], cameraDeviceId, micDeviceId)
+ return createLocalTracks({
+ devices: ['audio', 'video'],
+ cameraDeviceId: cameraDeviceId,
+ micDeviceId: micDeviceId
+ })
// If we fail to do this, try to create them separately.
- .catch(() => Promise.all(
- [createAudioTrack(false), createVideoTrack(false)]))
- .then((audioTracks, videoTracks) => {
+ .catch(() => Promise.all([
+ createAudioTrack(false).then(([stream]) => stream),
+ createVideoTrack(false).then(([stream]) => stream)
+ ]))
+ .then(tracks => {
if (audioTrackError || videoTrackError) {
APP.UI.showDeviceErrorDialog(
audioTrackError, videoTrackError);