Fixing various edge-cases when two gUM error dialogs might be shown and other possible bugs

This commit is contained in:
tsareg 2016-06-17 15:31:25 +03:00
parent 72d38ad202
commit 8b528b582f
2 changed files with 13 additions and 5 deletions

View File

@ -39,6 +39,8 @@ let sharedVideoManager;
let followMeHandler;
let deviceErrorDialog;
const TrackErrors = JitsiMeetJS.errors.track;
const JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP = {
@ -1267,7 +1269,11 @@ UI.showDeviceErrorDialog = function (micError, cameraError) {
message = `${message}${doNotShowWarningAgainSection}`;
messageHandler.openDialog(
// To make sure we don't have multiple error dialogs open at the same time,
// we will just close the previous one if we are going to show a new one.
deviceErrorDialog && deviceErrorDialog.close();
deviceErrorDialog = messageHandler.openDialog(
titleMsg,
message,
false,

View File

@ -194,15 +194,17 @@ export default {
return createLocalTracks(
['audio', 'video'], cameraDeviceId, 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);
}
return (audioTracks || []).concat(videoTracks || []);
return tracks.filter(t => typeof t !== 'undefined');
});
} else if (videoRequested && !audioRequested) {
return createVideoTrack();