Explorar el Código

fix(follow-me): disable the auto pin on SS

master
Hristo Terezov hace 5 años
padre
commit
13f76c2cce

+ 16
- 0
react/features/follow-me/functions.js Ver fichero

@@ -0,0 +1,16 @@
1
+// @flow
2
+
3
+import { toState } from '../base/redux';
4
+
5
+/**
6
+ * Returns true if follow me is active and false otherwise.
7
+ *
8
+ * @param {Object|Function} stateful - Object or function that can be resolved
9
+ * to the Redux state.
10
+ * @returns {boolean} - True if follow me is active and false otherwise.
11
+ */
12
+export function isFollowMeActive(stateful: Object | Function) {
13
+    const state = toState(stateful);
14
+
15
+    return Boolean(state['features/follow-me'].moderator);
16
+}

+ 1
- 0
react/features/follow-me/index.js Ver fichero

@@ -1,3 +1,4 @@
1
+export * from './functions';
1 2
 export * from './middleware';
2 3
 export * from './subscriber';
3 4
 

+ 2
- 1
react/features/follow-me/middleware.js Ver fichero

@@ -16,6 +16,7 @@ import { setFilmstripVisible } from '../filmstrip';
16 16
 import { setTileView } from '../video-layout';
17 17
 
18 18
 import { FOLLOW_ME_COMMAND } from './constants';
19
+import { isFollowMeActive } from './functions';
19 20
 import logger from './logger';
20 21
 
21 22
 declare var APP: Object;
@@ -111,7 +112,7 @@ function _onFollowMeCommand(attributes = {}, id, store) {
111 112
         return;
112 113
     }
113 114
 
114
-    if (!state['features/follow-me'].moderator) {
115
+    if (!isFollowMeActive(state)) {
115 116
         store.dispatch(setFollowMeModerator(id));
116 117
     }
117 118
 

+ 2
- 1
react/features/settings/functions.js Ver fichero

@@ -7,6 +7,7 @@ import {
7 7
     getLocalParticipant,
8 8
     isLocalParticipantModerator
9 9
 } from '../base/participants';
10
+import { isFollowMeActive } from '../follow-me';
10 11
 
11 12
 declare var interfaceConfig: Object;
12 13
 
@@ -85,7 +86,7 @@ export function getMoreTabProps(stateful: Object | Function) {
85 86
         startAudioMutedPolicy,
86 87
         startVideoMutedPolicy
87 88
     } = state['features/base/conference'];
88
-    const followMeActive = Boolean(state['features/follow-me'].moderator);
89
+    const followMeActive = isFollowMeActive(state);
89 90
     const configuredTabs = interfaceConfig.SETTINGS_SECTIONS || [];
90 91
 
91 92
     // The settings sections to display.

+ 4
- 3
react/features/video-layout/subscriber.js Ver fichero

@@ -11,7 +11,9 @@ import {
11 11
     pinParticipant
12 12
 } from '../base/participants';
13 13
 import { StateListenerRegistry, equals } from '../base/redux';
14
+import { isFollowMeActive } from '../follow-me';
14 15
 import { selectParticipant } from '../large-video';
16
+
15 17
 import { shouldDisplayTileView } from './functions';
16 18
 import { setParticipantsWithScreenShare } from './actions';
17 19
 
@@ -48,12 +50,11 @@ StateListenerRegistry.register(
48 50
 StateListenerRegistry.register(
49 51
     /* selector */ state => state['features/base/tracks'],
50 52
     /* listener */ debounce((tracks, store) => {
51
-        if (!_getAutoPinSetting()) {
53
+        if (!_getAutoPinSetting() || isFollowMeActive(store)) {
52 54
             return;
53 55
         }
54 56
 
55
-        const oldScreenSharesOrder
56
-            = store.getState()['features/video-layout'].screenShares || [];
57
+        const oldScreenSharesOrder = store.getState()['features/video-layout'].screenShares || [];
57 58
         const knownSharingParticipantIds = tracks.reduce((acc, track) => {
58 59
             if (track.mediaType === 'video' && track.videoType === 'desktop') {
59 60
                 const skipTrack = _getAutoPinSetting() === 'remote-only' && track.local;

Loading…
Cancelar
Guardar