Logs an error which occurred when trying to obtain video stream to be used after screen sharing.

This commit is contained in:
paweldomas 2016-01-28 10:51:09 -06:00
parent 8221a59261
commit cd8af2a823
1 changed files with 11 additions and 8 deletions

View File

@ -33,15 +33,15 @@ function newStreamCreated(track) {
eventEmitter.emit(DSEvents.NEW_STREAM_CREATED, track, streamSwitchDone); eventEmitter.emit(DSEvents.NEW_STREAM_CREATED, track, streamSwitchDone);
} }
function getVideoStreamFailed() { function getVideoStreamFailed(error) {
console.error("Failed to obtain the stream to switch to"); console.error("Failed to obtain the stream to switch to", error);
switchInProgress = false; switchInProgress = false;
isUsingScreenStream = false; isUsingScreenStream = false;
newStreamCreated(null); newStreamCreated(null);
} }
function getDesktopStreamFailed() { function getDesktopStreamFailed(error) {
console.error("Failed to obtain the stream to switch to"); console.error("Failed to obtain the stream to switch to", error);
switchInProgress = false; switchInProgress = false;
} }
@ -97,14 +97,17 @@ module.exports = {
} else { } else {
type = "video"; type = "video";
} }
var fail = () => { var fail = (error) => {
if (type === 'desktop') { if (type === 'desktop') {
getDesktopStreamFailed(); getDesktopStreamFailed(error);
} else { } else {
getVideoStreamFailed(); getVideoStreamFailed(error);
} }
}; };
APP.conference.createLocalTracks(type).then((tracks) => { APP.conference.createLocalTracks(type).then((tracks) => {
// FIXME does it mean that 'not track.length' == GUM failed ?
// And will this ever happen if promise is supposed to fail in GUM
// failed case ?
if (!tracks.length) { if (!tracks.length) {
fail(); fail();
return; return;
@ -125,7 +128,7 @@ module.exports = {
config.desktopSharingFirefoxExtensionURL); config.desktopSharingFirefoxExtensionURL);
return; return;
} }
fail(); fail(error);
}); });
} }
}; };