Adds 'firefox extention needed' error

This commit is contained in:
hristoterezov 2016-01-20 15:06:01 -06:00
parent e83d7b3b49
commit 653f706995
3 changed files with 8 additions and 15 deletions

View File

@ -15,10 +15,13 @@ module.exports = {
error.constraintName == "maxHeight") &&
devices.indexOf("video") !== -1) {
return this.UNSUPPORTED_RESOLUTION;
} else if(typeof error === "object" && error.type === "jitsiError") {
return error.object;
} else {
return this.GENERAL;
}
},
UNSUPPORTED_RESOLUTION: "gum.unsupported_resolution",
FIREFOX_EXTENSION_NEEDED: "gum.firefox_extension_needed",
GENERAL: "gum.general"
};

View File

@ -201,7 +201,7 @@ function setAvailableDevices(um, available) {
function onReady (options, GUM) {
rtcReady = true;
eventEmitter.emit(RTCEvents.RTC_READY, true);
screenObtainer.init(eventEmitter, options, GUM);
screenObtainer.init(options, GUM);
}
/**

View File

@ -5,6 +5,7 @@ var RTCBrowserType = require("./RTCBrowserType");
var AdapterJS = require("./adapter.screenshare");
var DesktopSharingEventTypes
= require("../../service/desktopsharing/DesktopSharingEventTypes");
var JitsiTrackErrors = require("../../JitsiTrackErrors");
/**
* Indicates whether the Chrome desktop sharing extension is installed.
@ -39,16 +40,11 @@ var GUM = null;
* Handles obtaining a stream from a screen capture on different browsers.
*/
var ScreenObtainer = {
/**
* The EventEmitter to use to emit events.
* @type {null}
*/
eventEmitter: null,
obtainStream: null,
/**
* Initializes the function used to obtain a screen capture
* (this.obtainStream).
*
*
* If the browser is Chrome, it uses the value of
* 'options.desktopSharingChromeMethod' (or 'options.desktopSharing') to
* decide whether to use the a Chrome extension (if the value is 'ext'),
@ -57,8 +53,7 @@ var ScreenObtainer = {
* Note that for the "screen" media source to work the
* 'chrome://flags/#enable-usermedia-screen-capture' flag must be set.
*/
init: function(eventEmitter, options, gum) {
this.eventEmitter = eventEmitter;
init: function(options, gum) {
var obtainDesktopStream = null;
this.options = options = options || {};
GUM = gum;
@ -174,14 +169,9 @@ var ScreenObtainer = {
firefoxExtInstalled = null;
reDetectFirefoxExtension = true;
// Prompt the user to install the extension
this.eventEmitter.emit(
DesktopSharingEventTypes.FIREFOX_EXTENSION_NEEDED,
this.options.desktopSharingFirefoxExtensionURL);
// Make sure desktopsharing knows that we failed, so that it doesn't get
// stuck in 'switching' mode.
errorCallback('Firefox extension required.');
errorCallback(JitsiTrackErrors.FIREFOX_EXTENSION_NEEDED);
},
/**
* Asks Chrome extension to call chooseDesktopMedia and gets chrome