Browse Source

feat(screenshare): allow auto-pin remote only

master
Leonard Kim 5 years ago
parent
commit
fa818bc386
2 changed files with 18 additions and 8 deletions
  1. 11
    7
      interface_config.js
  2. 7
    1
      react/features/video-layout/subscriber.js

+ 11
- 7
interface_config.js View File

@@ -177,7 +177,17 @@ var interfaceConfig = {
177 177
 
178 178
     // Browsers, in addition to those which do not fully support WebRTC, that
179 179
     // are not supported and should show the unsupported browser page.
180
-    UNSUPPORTED_BROWSERS: []
180
+    UNSUPPORTED_BROWSERS: [],
181
+
182
+    /**
183
+     * A UX mode where the last screen share participant is automatically
184
+     * pinned. Valid values are the string "remote-only" so remote participants
185
+     * get pinned but not local, otherwise any truthy value for all participants,
186
+     * and any falsy value to disable the feature.
187
+     *
188
+     * Note: this mode is experimental and subject to breakage.
189
+     */
190
+    AUTO_PIN_LATEST_SCREEN_SHARE: 'remote-only'
181 191
 
182 192
     /**
183 193
      * How many columns the tile view can expand to. The respected range is
@@ -205,12 +215,6 @@ var interfaceConfig = {
205 215
      */
206 216
     // ANDROID_APP_PACKAGE: 'org.jitsi.meet',
207 217
 
208
-    /**
209
-     * A UX mode where the last screen share participant is automatically
210
-     * pinned. Note: this mode is experimental and subject to breakage.
211
-     */
212
-    // AUTO_PIN_LATEST_SCREEN_SHARE: false,
213
-
214 218
     /**
215 219
      * Override the behavior of some notifications to remain displayed until
216 220
      * explicitly dismissed through a user action. The value is how long, in

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

@@ -55,7 +55,13 @@ StateListenerRegistry.register(
55 55
             = store.getState()['features/video-layout'].screenShares || [];
56 56
         const knownSharingParticipantIds = tracks.reduce((acc, track) => {
57 57
             if (track.mediaType === 'video' && track.videoType === 'desktop') {
58
-                acc.push(track.participantId);
58
+                const skipTrack
59
+                    = interfaceConfig.AUTO_PIN_LATEST_SCREEN_SHARE === 'remote-only'
60
+                        && track.local;
61
+
62
+                if (!skipTrack) {
63
+                    acc.push(track.participantId);
64
+                }
59 65
             }
60 66
 
61 67
             return acc;

Loading…
Cancel
Save