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);
}
function getVideoStreamFailed() {
console.error("Failed to obtain the stream to switch to");
function getVideoStreamFailed(error) {
console.error("Failed to obtain the stream to switch to", error);
switchInProgress = false;
isUsingScreenStream = false;
newStreamCreated(null);
}
function getDesktopStreamFailed() {
console.error("Failed to obtain the stream to switch to");
function getDesktopStreamFailed(error) {
console.error("Failed to obtain the stream to switch to", error);
switchInProgress = false;
}
@ -97,14 +97,17 @@ module.exports = {
} else {
type = "video";
}
var fail = () => {
var fail = (error) => {
if (type === 'desktop') {
getDesktopStreamFailed();
getDesktopStreamFailed(error);
} else {
getVideoStreamFailed();
getVideoStreamFailed(error);
}
};
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) {
fail();
return;
@ -125,7 +128,7 @@ module.exports = {
config.desktopSharingFirefoxExtensionURL);
return;
}
fail();
fail(error);
});
}
};