cleanup: Remove obsolete code related to SS extension
- Remove external install dialogs and fix related screensharing error handling. - Remove obsolete options from config.js and from configWhitelist.js
This commit is contained in:
parent
6fbba52c6d
commit
07cad2a98f
103
conference.js
103
conference.js
|
@ -1,4 +1,4 @@
|
||||||
/* global $, APP, JitsiMeetJS, config, interfaceConfig */
|
/* global APP, JitsiMeetJS, config, interfaceConfig */
|
||||||
|
|
||||||
import EventEmitter from 'events';
|
import EventEmitter from 'events';
|
||||||
import Logger from 'jitsi-meet-logger';
|
import Logger from 'jitsi-meet-logger';
|
||||||
|
@ -1642,8 +1642,6 @@ export default {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_createDesktopTrack(options = {}) {
|
_createDesktopTrack(options = {}) {
|
||||||
let externalInstallation = false;
|
|
||||||
let DSExternalInstallationInProgress = false;
|
|
||||||
const didHaveVideo = !this.isLocalVideoMuted();
|
const didHaveVideo = !this.isLocalVideoMuted();
|
||||||
|
|
||||||
const getDesktopStreamPromise = options.desktopStream
|
const getDesktopStreamPromise = options.desktopStream
|
||||||
|
@ -1652,43 +1650,7 @@ export default {
|
||||||
desktopSharingSourceDevice: options.desktopSharingSources
|
desktopSharingSourceDevice: options.desktopSharingSources
|
||||||
? null : config._desktopSharingSourceDevice,
|
? null : config._desktopSharingSourceDevice,
|
||||||
desktopSharingSources: options.desktopSharingSources,
|
desktopSharingSources: options.desktopSharingSources,
|
||||||
devices: [ 'desktop' ],
|
devices: [ 'desktop' ]
|
||||||
desktopSharingExtensionExternalInstallation: {
|
|
||||||
interval: 500,
|
|
||||||
checkAgain: () => DSExternalInstallationInProgress,
|
|
||||||
listener: (status, url) => {
|
|
||||||
switch (status) {
|
|
||||||
case 'waitingForExtension': {
|
|
||||||
DSExternalInstallationInProgress = true;
|
|
||||||
externalInstallation = true;
|
|
||||||
const listener = () => {
|
|
||||||
// Wait a little bit more just to be sure that
|
|
||||||
// we won't miss the extension installation
|
|
||||||
setTimeout(() => {
|
|
||||||
DSExternalInstallationInProgress = false;
|
|
||||||
},
|
|
||||||
500);
|
|
||||||
APP.UI.removeListener(
|
|
||||||
UIEvents.EXTERNAL_INSTALLATION_CANCELED,
|
|
||||||
listener);
|
|
||||||
};
|
|
||||||
|
|
||||||
APP.UI.addListener(
|
|
||||||
UIEvents.EXTERNAL_INSTALLATION_CANCELED,
|
|
||||||
listener);
|
|
||||||
APP.UI.showExtensionExternalInstallationDialog(url);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'extensionFound':
|
|
||||||
// Close the dialog.
|
|
||||||
externalInstallation && $.prompt.close();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
|
|
||||||
// Unknown status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return getDesktopStreamPromise.then(desktopStreams => {
|
return getDesktopStreamPromise.then(desktopStreams => {
|
||||||
|
@ -1712,15 +1674,8 @@ export default {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// close external installation dialog on success.
|
|
||||||
externalInstallation && $.prompt.close();
|
|
||||||
|
|
||||||
return desktopStreams;
|
return desktopStreams;
|
||||||
}, error => {
|
}, error => {
|
||||||
DSExternalInstallationInProgress = false;
|
|
||||||
|
|
||||||
// close external installation dialog on success.
|
|
||||||
externalInstallation && $.prompt.close();
|
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -1924,70 +1879,36 @@ export default {
|
||||||
/**
|
/**
|
||||||
* Handles {@link JitsiTrackError} returned by the lib-jitsi-meet when
|
* Handles {@link JitsiTrackError} returned by the lib-jitsi-meet when
|
||||||
* trying to create screensharing track. It will either do nothing if
|
* trying to create screensharing track. It will either do nothing if
|
||||||
* the dialog was canceled on user's request or display inline installation
|
* the dialog was canceled on user's request or display an error if
|
||||||
* dialog and ask the user to install the extension, once the extension is
|
* screensharing couldn't be started.
|
||||||
* installed it will switch the conference to screensharing. The last option
|
|
||||||
* is that an unrecoverable error dialog will be displayed.
|
|
||||||
* @param {JitsiTrackError} error - The error returned by
|
* @param {JitsiTrackError} error - The error returned by
|
||||||
* {@link _createDesktopTrack} Promise.
|
* {@link _createDesktopTrack} Promise.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_handleScreenSharingError(error) {
|
_handleScreenSharingError(error) {
|
||||||
if (error.name === JitsiTrackErrors.CHROME_EXTENSION_USER_CANCELED) {
|
if (error.name === JitsiTrackErrors.SCREENSHARING_USER_CANCELED) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.error('failed to share local desktop', error);
|
logger.error('failed to share local desktop', error);
|
||||||
|
|
||||||
if (error.name
|
|
||||||
=== JitsiTrackErrors.CHROME_EXTENSION_USER_GESTURE_REQUIRED) {
|
|
||||||
// If start with screen sharing the extension will fail to install
|
|
||||||
// (if not found), because the request has been triggered by the
|
|
||||||
// script. Show a dialog which asks user to click "install" and try
|
|
||||||
// again switching to the screen sharing.
|
|
||||||
APP.UI.showExtensionInlineInstallationDialog(
|
|
||||||
() => {
|
|
||||||
// eslint-disable-next-line no-empty-function
|
|
||||||
this.toggleScreenSharing().catch(() => {});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handling:
|
// Handling:
|
||||||
// JitsiTrackErrors.PERMISSION_DENIED
|
|
||||||
// JitsiTrackErrors.CHROME_EXTENSION_INSTALLATION_ERROR
|
|
||||||
// JitsiTrackErrors.CONSTRAINT_FAILED
|
// JitsiTrackErrors.CONSTRAINT_FAILED
|
||||||
// JitsiTrackErrors.GENERAL
|
// JitsiTrackErrors.PERMISSION_DENIED
|
||||||
|
// JitsiTrackErrors.SCREENSHARING_GENERIC_ERROR
|
||||||
// and any other
|
// and any other
|
||||||
let descriptionKey;
|
let descriptionKey;
|
||||||
let titleKey;
|
let titleKey;
|
||||||
|
|
||||||
if (error.name === JitsiTrackErrors.PERMISSION_DENIED) {
|
if (error.name === JitsiTrackErrors.PERMISSION_DENIED) {
|
||||||
|
descriptionKey = 'dialog.screenSharingPermissionDeniedError';
|
||||||
// in FF the only option for user is to deny access temporary or
|
titleKey = 'dialog.screenSharingFailedTitle';
|
||||||
// permanently and we only receive permission_denied
|
|
||||||
// we always show some info cause in case of permanently, no info
|
|
||||||
// shown will be bad experience
|
|
||||||
//
|
|
||||||
// TODO: detect interval between requesting permissions and received
|
|
||||||
// error, this way we can detect user interaction which will have
|
|
||||||
// longer delay
|
|
||||||
if (JitsiMeetJS.util.browser.isFirefox()) {
|
|
||||||
descriptionKey
|
|
||||||
= 'dialog.screenSharingFirefoxPermissionDeniedError';
|
|
||||||
titleKey = 'dialog.screenSharingFirefoxPermissionDeniedTitle';
|
|
||||||
} else {
|
|
||||||
descriptionKey = 'dialog.screenSharingPermissionDeniedError';
|
|
||||||
titleKey = 'dialog.screenSharingFailedToInstallTitle';
|
|
||||||
}
|
|
||||||
} else if (error.name === JitsiTrackErrors.CONSTRAINT_FAILED) {
|
} else if (error.name === JitsiTrackErrors.CONSTRAINT_FAILED) {
|
||||||
descriptionKey = 'dialog.cameraConstraintFailedError';
|
descriptionKey = 'dialog.cameraConstraintFailedError';
|
||||||
titleKey = 'deviceError.cameraError';
|
titleKey = 'deviceError.cameraError';
|
||||||
} else {
|
} else if (error.name === JitsiTrackErrors.SCREENSHARING_GENERIC_ERROR) {
|
||||||
descriptionKey = 'dialog.screenSharingFailedToInstall';
|
descriptionKey = 'dialog.screenSharingFailed';
|
||||||
titleKey = 'dialog.screenSharingFailedToInstallTitle';
|
titleKey = 'dialog.screenSharingFailedTitle';
|
||||||
}
|
}
|
||||||
|
|
||||||
APP.UI.messageHandler.showError({
|
APP.UI.messageHandler.showError({
|
||||||
|
|
16
config.js
16
config.js
|
@ -154,22 +154,6 @@ var config = {
|
||||||
|
|
||||||
// Desktop sharing
|
// Desktop sharing
|
||||||
|
|
||||||
// The ID of the jidesha extension for Chrome.
|
|
||||||
desktopSharingChromeExtId: null,
|
|
||||||
|
|
||||||
// Whether desktop sharing should be disabled on Chrome.
|
|
||||||
// desktopSharingChromeDisabled: false,
|
|
||||||
|
|
||||||
// The media sources to use when using screen sharing with the Chrome
|
|
||||||
// extension.
|
|
||||||
desktopSharingChromeSources: [ 'screen', 'window', 'tab' ],
|
|
||||||
|
|
||||||
// Required version of Chrome extension
|
|
||||||
desktopSharingChromeMinExtVersion: '0.1',
|
|
||||||
|
|
||||||
// Whether desktop sharing should be disabled on Firefox.
|
|
||||||
// desktopSharingFirefoxDisabled: false,
|
|
||||||
|
|
||||||
// Optional desktop sharing frame rate options. Default value: min:5, max:5.
|
// Optional desktop sharing frame rate options. Default value: min:5, max:5.
|
||||||
// desktopSharingFrameRate: {
|
// desktopSharingFrameRate: {
|
||||||
// min: 5,
|
// min: 5,
|
||||||
|
|
|
@ -202,15 +202,10 @@
|
||||||
"e2eeWarning": "WARNING: Not all participants in this meeting seem to have support for End-to-End encryption. If you enable it they won't be able to see nor hear you.",
|
"e2eeWarning": "WARNING: Not all participants in this meeting seem to have support for End-to-End encryption. If you enable it they won't be able to see nor hear you.",
|
||||||
"enterDisplayName": "Please enter your name here",
|
"enterDisplayName": "Please enter your name here",
|
||||||
"error": "Error",
|
"error": "Error",
|
||||||
"externalInstallationMsg": "You need to install our desktop sharing extension.",
|
|
||||||
"externalInstallationTitle": "Extension required",
|
|
||||||
"goToStore": "Go to the webstore",
|
|
||||||
"gracefulShutdown": "Our service is currently down for maintenance. Please try again later.",
|
"gracefulShutdown": "Our service is currently down for maintenance. Please try again later.",
|
||||||
"IamHost": "I am the host",
|
"IamHost": "I am the host",
|
||||||
"incorrectRoomLockPassword": "Incorrect password",
|
"incorrectRoomLockPassword": "Incorrect password",
|
||||||
"incorrectPassword": "Incorrect username or password",
|
"incorrectPassword": "Incorrect username or password",
|
||||||
"inlineInstallationMsg": "You need to install our desktop sharing extension.",
|
|
||||||
"inlineInstallExtension": "Install now",
|
|
||||||
"internalError": "Oops! Something went wrong. The following error occurred: {{error}}",
|
"internalError": "Oops! Something went wrong. The following error occurred: {{error}}",
|
||||||
"internalErrorTitle": "Internal error",
|
"internalErrorTitle": "Internal error",
|
||||||
"kickMessage": "You can contact {{participantDisplayName}} for more details.",
|
"kickMessage": "You can contact {{participantDisplayName}} for more details.",
|
||||||
|
@ -272,11 +267,9 @@
|
||||||
"reservationErrorMsg": "Error code: {{code}}, message: {{msg}}",
|
"reservationErrorMsg": "Error code: {{code}}, message: {{msg}}",
|
||||||
"retry": "Retry",
|
"retry": "Retry",
|
||||||
"screenSharingAudio": "Share audio",
|
"screenSharingAudio": "Share audio",
|
||||||
"screenSharingFailedToInstall": "Oops! Your screen sharing extension failed to install.",
|
"screenSharingFailed": "Oops! Something went wrong, we weren’t able to start screen sharing!",
|
||||||
"screenSharingFailedToInstallTitle": "Screen sharing extension failed to install",
|
"screenSharingFailedTitle": "Screen sharing failed!",
|
||||||
"screenSharingFirefoxPermissionDeniedError": "Something went wrong while we were trying to share your screen. Please make sure that you have given us permission to do so.",
|
"screenSharingPermissionDeniedError": "Oops! Something went wrong with your screen sharing permissions. Please reload and try again.",
|
||||||
"screenSharingFirefoxPermissionDeniedTitle": "Oops! We weren’t able to start screen sharing!",
|
|
||||||
"screenSharingPermissionDeniedError": "Oops! Something went wrong with your screen sharing extension permissions. Please reload and try again.",
|
|
||||||
"sendPrivateMessage": "You recently received a private message. Did you intend to reply to that privately, or you want to send your message to the group?",
|
"sendPrivateMessage": "You recently received a private message. Did you intend to reply to that privately, or you want to send your message to the group?",
|
||||||
"sendPrivateMessageCancel": "Send to the group",
|
"sendPrivateMessageCancel": "Send to the group",
|
||||||
"sendPrivateMessageOk": "Send privately",
|
"sendPrivateMessageOk": "Send privately",
|
||||||
|
|
|
@ -553,82 +553,6 @@ UI.getLargeVideo = function() {
|
||||||
return VideoLayout.getLargeVideo();
|
return VideoLayout.getLargeVideo();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Shows "Please go to chrome webstore to install the desktop sharing extension"
|
|
||||||
* 2 button dialog with buttons - cancel and go to web store.
|
|
||||||
* @param url {string} the url of the extension.
|
|
||||||
*/
|
|
||||||
UI.showExtensionExternalInstallationDialog = function(url) {
|
|
||||||
let openedWindow = null;
|
|
||||||
|
|
||||||
const submitFunction = function(e, v) {
|
|
||||||
if (v) {
|
|
||||||
e.preventDefault();
|
|
||||||
if (openedWindow === null || openedWindow.closed) {
|
|
||||||
openedWindow
|
|
||||||
= window.open(
|
|
||||||
url,
|
|
||||||
'extension_store_window',
|
|
||||||
'resizable,scrollbars=yes,status=1');
|
|
||||||
} else {
|
|
||||||
openedWindow.focus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const closeFunction = function(e, v) {
|
|
||||||
if (openedWindow) {
|
|
||||||
// Ideally we would close the popup, but this does not seem to work
|
|
||||||
// on Chrome. Leaving it uncommented in case it could work
|
|
||||||
// in some version.
|
|
||||||
openedWindow.close();
|
|
||||||
openedWindow = null;
|
|
||||||
}
|
|
||||||
if (!v) {
|
|
||||||
eventEmitter.emit(UIEvents.EXTERNAL_INSTALLATION_CANCELED);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
messageHandler.openTwoButtonDialog({
|
|
||||||
titleKey: 'dialog.externalInstallationTitle',
|
|
||||||
msgKey: 'dialog.externalInstallationMsg',
|
|
||||||
leftButtonKey: 'dialog.goToStore',
|
|
||||||
submitFunction,
|
|
||||||
loadedFunction: $.noop,
|
|
||||||
closeFunction
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shows a dialog which asks user to install the extension. This one is
|
|
||||||
* displayed after installation is triggered from the script, but fails because
|
|
||||||
* it must be initiated by user gesture.
|
|
||||||
* @param callback {function} function to be executed after user clicks
|
|
||||||
* the install button - it should make another attempt to install the extension.
|
|
||||||
*/
|
|
||||||
UI.showExtensionInlineInstallationDialog = function(callback) {
|
|
||||||
const submitFunction = function(e, v) {
|
|
||||||
if (v) {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const closeFunction = function(e, v) {
|
|
||||||
if (!v) {
|
|
||||||
eventEmitter.emit(UIEvents.EXTERNAL_INSTALLATION_CANCELED);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
messageHandler.openTwoButtonDialog({
|
|
||||||
titleKey: 'dialog.externalInstallationTitle',
|
|
||||||
msgKey: 'dialog.inlineInstallationMsg',
|
|
||||||
leftButtonKey: 'dialog.inlineInstallExtension',
|
|
||||||
submitFunction,
|
|
||||||
loadedFunction: $.noop,
|
|
||||||
closeFunction
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show shared video.
|
* Show shared video.
|
||||||
* @param {string} id the id of the sender of the command
|
* @param {string} id the id of the sender of the command
|
||||||
|
|
|
@ -72,11 +72,6 @@ export default [
|
||||||
'debug',
|
'debug',
|
||||||
'debugAudioLevels',
|
'debugAudioLevels',
|
||||||
'defaultLanguage',
|
'defaultLanguage',
|
||||||
'desktopSharingChromeDisabled',
|
|
||||||
'desktopSharingChromeExtId',
|
|
||||||
'desktopSharingChromeMinExtVersion',
|
|
||||||
'desktopSharingChromeSources',
|
|
||||||
'desktopSharingFirefoxDisabled',
|
|
||||||
'desktopSharingFrameRate',
|
'desktopSharingFrameRate',
|
||||||
'desktopSharingSources',
|
'desktopSharingSources',
|
||||||
'disable1On1Mode',
|
'disable1On1Mode',
|
||||||
|
|
|
@ -104,8 +104,6 @@ export function createLocalTracksF(options = {}, firePermissionPromptIsShownEven
|
||||||
{
|
{
|
||||||
cameraDeviceId,
|
cameraDeviceId,
|
||||||
constraints,
|
constraints,
|
||||||
desktopSharingExtensionExternalInstallation:
|
|
||||||
options.desktopSharingExtensionExternalInstallation,
|
|
||||||
desktopSharingFrameRate,
|
desktopSharingFrameRate,
|
||||||
desktopSharingSourceDevice:
|
desktopSharingSourceDevice:
|
||||||
options.desktopSharingSourceDevice,
|
options.desktopSharingSourceDevice,
|
||||||
|
|
|
@ -53,12 +53,6 @@ export default {
|
||||||
*/
|
*/
|
||||||
LOCAL_FLIPX_CHANGED: 'UI.local_flipx_changed',
|
LOCAL_FLIPX_CHANGED: 'UI.local_flipx_changed',
|
||||||
|
|
||||||
/**
|
|
||||||
* Notifies that the button "Cancel" is pressed on the dialog for
|
|
||||||
* external extension installation.
|
|
||||||
*/
|
|
||||||
EXTERNAL_INSTALLATION_CANCELED: 'UI.external_installation_canceled',
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notifies that the side toolbar container has been toggled. The actual
|
* Notifies that the side toolbar container has been toggled. The actual
|
||||||
* event must contain the identifier of the container that has been toggled
|
* event must contain the identifier of the container that has been toggled
|
||||||
|
|
Loading…
Reference in New Issue