Browse Source

rn: enable auto-pinning on screenshare on mobile

master
Saúl Ibarra Corretgé 6 years ago
parent
commit
6943659dc9
1 changed files with 7 additions and 6 deletions
  1. 7
    6
      react/features/video-layout/subscriber.js

+ 7
- 6
react/features/video-layout/subscriber.js View File

@@ -16,6 +16,10 @@ import { setParticipantsWithScreenShare } from './actions';
16 16
 declare var APP: Object;
17 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 24
  * StateListenerRegistry provides a reliable way of detecting changes to
21 25
  * preferred layout state and dispatching additional actions.
@@ -31,8 +35,7 @@ StateListenerRegistry.register(
31 35
             dispatch(
32 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 39
                 _updateAutoPinnedParticipant(store);
37 40
             }
38 41
         }
@@ -46,8 +49,7 @@ StateListenerRegistry.register(
46 49
 StateListenerRegistry.register(
47 50
     /* selector */ state => state['features/base/tracks'],
48 51
     /* listener */ (tracks, store) => {
49
-        if (typeof interfaceConfig !== 'object'
50
-            || !interfaceConfig.AUTO_PIN_LATEST_SCREEN_SHARE) {
52
+        if (!AUTO_PIN_LATEST_SCREEN_SHARE) {
51 53
             return;
52 54
         }
53 55
 
@@ -56,8 +58,7 @@ StateListenerRegistry.register(
56 58
         const knownSharingParticipantIds = tracks.reduce((acc, track) => {
57 59
             if (track.mediaType === 'video' && track.videoType === 'desktop') {
58 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 63
                 if (!skipTrack) {
63 64
                     acc.push(track.participantId);

Loading…
Cancel
Save