Browse Source

Merge pull request #3782 from virtuacoplenny/lenny/camera-as-ss

feat(screenshare): use camera as a screenshare source
master
virtuacoplenny 6 years ago
parent
commit
998db80db1
No account linked to committer's email address
4 changed files with 16 additions and 0 deletions
  1. 6
    0
      conference.js
  2. 7
    0
      config.js
  3. 1
    0
      react/features/base/config/functions.js
  4. 2
    0
      react/features/base/tracks/functions.js

+ 6
- 0
conference.js View File

1488
         const wasVideoMuted = this.isLocalVideoMuted();
1488
         const wasVideoMuted = this.isLocalVideoMuted();
1489
 
1489
 
1490
         return createLocalTracksF({
1490
         return createLocalTracksF({
1491
+            desktopSharingSourceDevice: options.desktopSharingSources
1492
+                ? null : config._desktopSharingSourceDevice,
1491
             desktopSharingSources: options.desktopSharingSources,
1493
             desktopSharingSources: options.desktopSharingSources,
1492
             devices: [ 'desktop' ],
1494
             devices: [ 'desktop' ],
1493
             desktopSharingExtensionExternalInstallation: {
1495
             desktopSharingExtensionExternalInstallation: {
1645
         // Handling:
1647
         // Handling:
1646
         // JitsiTrackErrors.PERMISSION_DENIED
1648
         // JitsiTrackErrors.PERMISSION_DENIED
1647
         // JitsiTrackErrors.CHROME_EXTENSION_INSTALLATION_ERROR
1649
         // JitsiTrackErrors.CHROME_EXTENSION_INSTALLATION_ERROR
1650
+        // JitsiTrackErrors.CONSTRAINT_FAILED
1648
         // JitsiTrackErrors.GENERAL
1651
         // JitsiTrackErrors.GENERAL
1649
         // and any other
1652
         // and any other
1650
         let descriptionKey;
1653
         let descriptionKey;
1668
                 descriptionKey = 'dialog.screenSharingPermissionDeniedError';
1671
                 descriptionKey = 'dialog.screenSharingPermissionDeniedError';
1669
                 titleKey = 'dialog.screenSharingFailedToInstallTitle';
1672
                 titleKey = 'dialog.screenSharingFailedToInstallTitle';
1670
             }
1673
             }
1674
+        } else if (error.name === JitsiTrackErrors.CONSTRAINT_FAILED) {
1675
+            descriptionKey = 'dialog.cameraConstraintFailedError';
1676
+            titleKey = 'deviceError.cameraError';
1671
         } else {
1677
         } else {
1672
             descriptionKey = 'dialog.screenSharingFailedToInstall';
1678
             descriptionKey = 'dialog.screenSharingFailedToInstall';
1673
             titleKey = 'dialog.screenSharingFailedToInstallTitle';
1679
             titleKey = 'dialog.screenSharingFailedToInstallTitle';

+ 7
- 0
config.js View File

386
     //   analyticsInterval: 60000,
386
     //   analyticsInterval: 60000,
387
     //   }
387
     //   }
388
 
388
 
389
+    // If set, will attempt to use the provided video input device label when
390
+    // triggering a screenshare, instead of proceeding through the normal flow
391
+    // for obtaining a desktop stream.
392
+    // NOTE: This option is experimental and is currently intended for internal
393
+    // use only.
394
+    // _desktopSharingSourceDevice: 'sample-id-or-label'
395
+
389
     // List of undocumented settings used in jitsi-meet
396
     // List of undocumented settings used in jitsi-meet
390
     /**
397
     /**
391
      _immediateReloadThreshold
398
      _immediateReloadThreshold

+ 1
- 0
react/features/base/config/functions.js View File

17
  * @type Array
17
  * @type Array
18
  */
18
  */
19
 const WHITELISTED_KEYS = [
19
 const WHITELISTED_KEYS = [
20
+    '_desktopSharingSourceDevice',
20
     '_peerConnStatusOutOfLastNTimeout',
21
     '_peerConnStatusOutOfLastNTimeout',
21
     '_peerConnStatusRtcMuteTimeout',
22
     '_peerConnStatusRtcMuteTimeout',
22
     'abTesting',
23
     'abTesting',

+ 2
- 0
react/features/base/tracks/functions.js View File

62
                 desktopSharingExtensionExternalInstallation:
62
                 desktopSharingExtensionExternalInstallation:
63
                     options.desktopSharingExtensionExternalInstallation,
63
                     options.desktopSharingExtensionExternalInstallation,
64
                 desktopSharingFrameRate,
64
                 desktopSharingFrameRate,
65
+                desktopSharingSourceDevice:
66
+                    options.desktopSharingSourceDevice,
65
                 desktopSharingSources: options.desktopSharingSources,
67
                 desktopSharingSources: options.desktopSharingSources,
66
 
68
 
67
                 // Copy array to avoid mutations inside library.
69
                 // Copy array to avoid mutations inside library.

Loading…
Cancel
Save