Logs an error which occurred when trying to obtain video stream to be used after screen sharing.
This commit is contained in:
parent
8221a59261
commit
cd8af2a823
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue