Sfoglia il codice sorgente

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

master
Hristo Terezov 5 anni fa
parent
commit
13f76c2cce

+ 16
- 0
react/features/follow-me/functions.js Vedi File

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 Vedi File

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

+ 2
- 1
react/features/follow-me/middleware.js Vedi File

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

+ 2
- 1
react/features/settings/functions.js Vedi File

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

+ 4
- 3
react/features/video-layout/subscriber.js Vedi File

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

Loading…
Annulla
Salva