浏览代码

feat(screenshare): use camera as a screenshare source

This feature is intended for spot. Spot can have an
HDMI -> usb adapter hooked up to it. In that case,
attempting to screenshare should use that adapter
as a screensharing source. Jitsi-Meet should pass
a configured screenshare source into lib-jitsi-meet
so it can be used as a source.
master
Leonard Kim 6 年前
父节点
当前提交
69dfa30142
共有 4 个文件被更改,包括 16 次插入0 次删除
  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 查看文件

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

+ 7
- 0
config.js 查看文件

@@ -386,6 +386,13 @@ var config = {
386 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 396
     // List of undocumented settings used in jitsi-meet
390 397
     /**
391 398
      _immediateReloadThreshold

+ 1
- 0
react/features/base/config/functions.js 查看文件

@@ -17,6 +17,7 @@ declare var $: Object;
17 17
  * @type Array
18 18
  */
19 19
 const WHITELISTED_KEYS = [
20
+    '_desktopSharingSourceDevice',
20 21
     '_peerConnStatusOutOfLastNTimeout',
21 22
     '_peerConnStatusRtcMuteTimeout',
22 23
     'abTesting',

+ 2
- 0
react/features/base/tracks/functions.js 查看文件

@@ -62,6 +62,8 @@ export function createLocalTracksF(
62 62
                 desktopSharingExtensionExternalInstallation:
63 63
                     options.desktopSharingExtensionExternalInstallation,
64 64
                 desktopSharingFrameRate,
65
+                desktopSharingSourceDevice:
66
+                    options.desktopSharingSourceDevice,
65 67
                 desktopSharingSources: options.desktopSharingSources,
66 68
 
67 69
                 // Copy array to avoid mutations inside library.

正在加载...
取消
保存