Firefox error handler when DS fails

This commit is contained in:
perroned 2016-02-23 14:01:49 -08:00
parent 56a8bc78d5
commit a42c9765f7

View File

@ -1085,6 +1085,7 @@
// Commit: 05488dda5d9d1048e286b0bdee27515d217b15a5 // Commit: 05488dda5d9d1048e286b0bdee27515d217b15a5
var constraints = {}; var constraints = {};
var errorCallback = null;
if (window.firefoxDesksharePresent) { if (window.firefoxDesksharePresent) {
window.firefoxDesksharePresent = false; window.firefoxDesksharePresent = false;
constraints = { constraints = {
@ -1100,12 +1101,18 @@
video: video_constraints video: video_constraints
}; };
} }
// if a callback was added use it, otherwise use default error handler
n.getMedia(constraints, if (typeof window.firefoxDesksharePresentErrorCallback === "function") {
// ---------------------------------------------------------- errorCallback = window.firefoxDesksharePresentErrorCallback;
streaming, options.onerror || } else {
errorCallback = options.onerror ||
function(e) { function(e) {
console.error(e); console.error(e);
}
}
n.getMedia(constraints, streaming, function() {
errorCallback({'status': 'Failed to getUserMedia on Firefox', 'errorcode': 2000});
}); });
function streaming(stream) { function streaming(stream) {