浏览代码

rn: enable auto-pinning on screenshare on mobile

master
Saúl Ibarra Corretgé 6 年前
父节点
当前提交
6943659dc9
共有 1 个文件被更改,包括 7 次插入6 次删除
  1. 7
    6
      react/features/video-layout/subscriber.js

+ 7
- 6
react/features/video-layout/subscriber.js 查看文件

16
 declare var APP: Object;
16
 declare var APP: Object;
17
 declare var interfaceConfig: Object;
17
 declare var interfaceConfig: Object;
18
 
18
 
19
+// TODO: interfaceConfig should be in redux so we didn't have to do this.
20
+const AUTO_PIN_LATEST_SCREEN_SHARE
21
+    = typeof interfaceConfig === 'object' ? interfaceConfig.AUTO_PIN_LATEST_SCREEN_SHARE : 'remote-only';
22
+
19
 /**
23
 /**
20
  * StateListenerRegistry provides a reliable way of detecting changes to
24
  * StateListenerRegistry provides a reliable way of detecting changes to
21
  * preferred layout state and dispatching additional actions.
25
  * preferred layout state and dispatching additional actions.
31
             dispatch(
35
             dispatch(
32
                 setMaxReceiverVideoQuality(VIDEO_QUALITY_LEVELS.HIGH));
36
                 setMaxReceiverVideoQuality(VIDEO_QUALITY_LEVELS.HIGH));
33
 
37
 
34
-            if (typeof interfaceConfig === 'object'
35
-                && interfaceConfig.AUTO_PIN_LATEST_SCREEN_SHARE) {
38
+            if (AUTO_PIN_LATEST_SCREEN_SHARE) {
36
                 _updateAutoPinnedParticipant(store);
39
                 _updateAutoPinnedParticipant(store);
37
             }
40
             }
38
         }
41
         }
46
 StateListenerRegistry.register(
49
 StateListenerRegistry.register(
47
     /* selector */ state => state['features/base/tracks'],
50
     /* selector */ state => state['features/base/tracks'],
48
     /* listener */ (tracks, store) => {
51
     /* listener */ (tracks, store) => {
49
-        if (typeof interfaceConfig !== 'object'
50
-            || !interfaceConfig.AUTO_PIN_LATEST_SCREEN_SHARE) {
52
+        if (!AUTO_PIN_LATEST_SCREEN_SHARE) {
51
             return;
53
             return;
52
         }
54
         }
53
 
55
 
56
         const knownSharingParticipantIds = tracks.reduce((acc, track) => {
58
         const knownSharingParticipantIds = tracks.reduce((acc, track) => {
57
             if (track.mediaType === 'video' && track.videoType === 'desktop') {
59
             if (track.mediaType === 'video' && track.videoType === 'desktop') {
58
                 const skipTrack
60
                 const skipTrack
59
-                    = interfaceConfig.AUTO_PIN_LATEST_SCREEN_SHARE === 'remote-only'
60
-                        && track.local;
61
+                    = AUTO_PIN_LATEST_SCREEN_SHARE === 'remote-only' && track.local;
61
 
62
 
62
                 if (!skipTrack) {
63
                 if (!skipTrack) {
63
                     acc.push(track.participantId);
64
                     acc.push(track.participantId);

正在加载...
取消
保存