|
@@ -1,4 +1,4 @@
|
1
|
|
-/* global $, APP, JitsiMeetJS, config, interfaceConfig */
|
|
1
|
+/* global APP, JitsiMeetJS, config, interfaceConfig */
|
2
|
2
|
|
3
|
3
|
import EventEmitter from 'events';
|
4
|
4
|
import Logger from 'jitsi-meet-logger';
|
|
@@ -1642,8 +1642,6 @@ export default {
|
1642
|
1642
|
* @private
|
1643
|
1643
|
*/
|
1644
|
1644
|
_createDesktopTrack(options = {}) {
|
1645
|
|
- let externalInstallation = false;
|
1646
|
|
- let DSExternalInstallationInProgress = false;
|
1647
|
1645
|
const didHaveVideo = !this.isLocalVideoMuted();
|
1648
|
1646
|
|
1649
|
1647
|
const getDesktopStreamPromise = options.desktopStream
|
|
@@ -1652,43 +1650,7 @@ export default {
|
1652
|
1650
|
desktopSharingSourceDevice: options.desktopSharingSources
|
1653
|
1651
|
? null : config._desktopSharingSourceDevice,
|
1654
|
1652
|
desktopSharingSources: options.desktopSharingSources,
|
1655
|
|
- devices: [ 'desktop' ],
|
1656
|
|
- desktopSharingExtensionExternalInstallation: {
|
1657
|
|
- interval: 500,
|
1658
|
|
- checkAgain: () => DSExternalInstallationInProgress,
|
1659
|
|
- listener: (status, url) => {
|
1660
|
|
- switch (status) {
|
1661
|
|
- case 'waitingForExtension': {
|
1662
|
|
- DSExternalInstallationInProgress = true;
|
1663
|
|
- externalInstallation = true;
|
1664
|
|
- const listener = () => {
|
1665
|
|
- // Wait a little bit more just to be sure that
|
1666
|
|
- // we won't miss the extension installation
|
1667
|
|
- setTimeout(() => {
|
1668
|
|
- DSExternalInstallationInProgress = false;
|
1669
|
|
- },
|
1670
|
|
- 500);
|
1671
|
|
- APP.UI.removeListener(
|
1672
|
|
- UIEvents.EXTERNAL_INSTALLATION_CANCELED,
|
1673
|
|
- listener);
|
1674
|
|
- };
|
1675
|
|
-
|
1676
|
|
- APP.UI.addListener(
|
1677
|
|
- UIEvents.EXTERNAL_INSTALLATION_CANCELED,
|
1678
|
|
- listener);
|
1679
|
|
- APP.UI.showExtensionExternalInstallationDialog(url);
|
1680
|
|
- break;
|
1681
|
|
- }
|
1682
|
|
- case 'extensionFound':
|
1683
|
|
- // Close the dialog.
|
1684
|
|
- externalInstallation && $.prompt.close();
|
1685
|
|
- break;
|
1686
|
|
- default:
|
1687
|
|
-
|
1688
|
|
- // Unknown status
|
1689
|
|
- }
|
1690
|
|
- }
|
1691
|
|
- }
|
|
1653
|
+ devices: [ 'desktop' ]
|
1692
|
1654
|
});
|
1693
|
1655
|
|
1694
|
1656
|
return getDesktopStreamPromise.then(desktopStreams => {
|
|
@@ -1712,15 +1674,8 @@ export default {
|
1712
|
1674
|
);
|
1713
|
1675
|
}
|
1714
|
1676
|
|
1715
|
|
- // close external installation dialog on success.
|
1716
|
|
- externalInstallation && $.prompt.close();
|
1717
|
|
-
|
1718
|
1677
|
return desktopStreams;
|
1719
|
1678
|
}, error => {
|
1720
|
|
- DSExternalInstallationInProgress = false;
|
1721
|
|
-
|
1722
|
|
- // close external installation dialog on success.
|
1723
|
|
- externalInstallation && $.prompt.close();
|
1724
|
1679
|
throw error;
|
1725
|
1680
|
});
|
1726
|
1681
|
},
|
|
@@ -1924,70 +1879,36 @@ export default {
|
1924
|
1879
|
/**
|
1925
|
1880
|
* Handles {@link JitsiTrackError} returned by the lib-jitsi-meet when
|
1926
|
1881
|
* trying to create screensharing track. It will either do nothing if
|
1927
|
|
- * the dialog was canceled on user's request or display inline installation
|
1928
|
|
- * dialog and ask the user to install the extension, once the extension is
|
1929
|
|
- * installed it will switch the conference to screensharing. The last option
|
1930
|
|
- * is that an unrecoverable error dialog will be displayed.
|
|
1882
|
+ * the dialog was canceled on user's request or display an error if
|
|
1883
|
+ * screensharing couldn't be started.
|
1931
|
1884
|
* @param {JitsiTrackError} error - The error returned by
|
1932
|
1885
|
* {@link _createDesktopTrack} Promise.
|
1933
|
1886
|
* @private
|
1934
|
1887
|
*/
|
1935
|
1888
|
_handleScreenSharingError(error) {
|
1936
|
|
- if (error.name === JitsiTrackErrors.CHROME_EXTENSION_USER_CANCELED) {
|
|
1889
|
+ if (error.name === JitsiTrackErrors.SCREENSHARING_USER_CANCELED) {
|
1937
|
1890
|
return;
|
1938
|
1891
|
}
|
1939
|
1892
|
|
1940
|
1893
|
logger.error('failed to share local desktop', error);
|
1941
|
1894
|
|
1942
|
|
- if (error.name
|
1943
|
|
- === JitsiTrackErrors.CHROME_EXTENSION_USER_GESTURE_REQUIRED) {
|
1944
|
|
- // If start with screen sharing the extension will fail to install
|
1945
|
|
- // (if not found), because the request has been triggered by the
|
1946
|
|
- // script. Show a dialog which asks user to click "install" and try
|
1947
|
|
- // again switching to the screen sharing.
|
1948
|
|
- APP.UI.showExtensionInlineInstallationDialog(
|
1949
|
|
- () => {
|
1950
|
|
- // eslint-disable-next-line no-empty-function
|
1951
|
|
- this.toggleScreenSharing().catch(() => {});
|
1952
|
|
- }
|
1953
|
|
- );
|
1954
|
|
-
|
1955
|
|
- return;
|
1956
|
|
- }
|
1957
|
|
-
|
1958
|
1895
|
// Handling:
|
1959
|
|
- // JitsiTrackErrors.PERMISSION_DENIED
|
1960
|
|
- // JitsiTrackErrors.CHROME_EXTENSION_INSTALLATION_ERROR
|
1961
|
1896
|
// JitsiTrackErrors.CONSTRAINT_FAILED
|
1962
|
|
- // JitsiTrackErrors.GENERAL
|
|
1897
|
+ // JitsiTrackErrors.PERMISSION_DENIED
|
|
1898
|
+ // JitsiTrackErrors.SCREENSHARING_GENERIC_ERROR
|
1963
|
1899
|
// and any other
|
1964
|
1900
|
let descriptionKey;
|
1965
|
1901
|
let titleKey;
|
1966
|
1902
|
|
1967
|
1903
|
if (error.name === JitsiTrackErrors.PERMISSION_DENIED) {
|
1968
|
|
-
|
1969
|
|
- // in FF the only option for user is to deny access temporary or
|
1970
|
|
- // permanently and we only receive permission_denied
|
1971
|
|
- // we always show some info cause in case of permanently, no info
|
1972
|
|
- // shown will be bad experience
|
1973
|
|
- //
|
1974
|
|
- // TODO: detect interval between requesting permissions and received
|
1975
|
|
- // error, this way we can detect user interaction which will have
|
1976
|
|
- // longer delay
|
1977
|
|
- if (JitsiMeetJS.util.browser.isFirefox()) {
|
1978
|
|
- descriptionKey
|
1979
|
|
- = 'dialog.screenSharingFirefoxPermissionDeniedError';
|
1980
|
|
- titleKey = 'dialog.screenSharingFirefoxPermissionDeniedTitle';
|
1981
|
|
- } else {
|
1982
|
|
- descriptionKey = 'dialog.screenSharingPermissionDeniedError';
|
1983
|
|
- titleKey = 'dialog.screenSharingFailedToInstallTitle';
|
1984
|
|
- }
|
|
1904
|
+ descriptionKey = 'dialog.screenSharingPermissionDeniedError';
|
|
1905
|
+ titleKey = 'dialog.screenSharingFailedTitle';
|
1985
|
1906
|
} else if (error.name === JitsiTrackErrors.CONSTRAINT_FAILED) {
|
1986
|
1907
|
descriptionKey = 'dialog.cameraConstraintFailedError';
|
1987
|
1908
|
titleKey = 'deviceError.cameraError';
|
1988
|
|
- } else {
|
1989
|
|
- descriptionKey = 'dialog.screenSharingFailedToInstall';
|
1990
|
|
- titleKey = 'dialog.screenSharingFailedToInstallTitle';
|
|
1909
|
+ } else if (error.name === JitsiTrackErrors.SCREENSHARING_GENERIC_ERROR) {
|
|
1910
|
+ descriptionKey = 'dialog.screenSharingFailed';
|
|
1911
|
+ titleKey = 'dialog.screenSharingFailedTitle';
|
1991
|
1912
|
}
|
1992
|
1913
|
|
1993
|
1914
|
APP.UI.messageHandler.showError({
|