fix(follow-me): disable the auto pin on SS
This commit is contained in:
parent
9ad87f3706
commit
13f76c2cce
16
react/features/follow-me/functions.js
Normal file
16
react/features/follow-me/functions.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// @flow
|
||||||
|
|
||||||
|
import { toState } from '../base/redux';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if follow me is active and false otherwise.
|
||||||
|
*
|
||||||
|
* @param {Object|Function} stateful - Object or function that can be resolved
|
||||||
|
* to the Redux state.
|
||||||
|
* @returns {boolean} - True if follow me is active and false otherwise.
|
||||||
|
*/
|
||||||
|
export function isFollowMeActive(stateful: Object | Function) {
|
||||||
|
const state = toState(stateful);
|
||||||
|
|
||||||
|
return Boolean(state['features/follow-me'].moderator);
|
||||||
|
}
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
export * from './functions';
|
||||||
export * from './middleware';
|
export * from './middleware';
|
||||||
export * from './subscriber';
|
export * from './subscriber';
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import { setFilmstripVisible } from '../filmstrip';
|
|||||||
import { setTileView } from '../video-layout';
|
import { setTileView } from '../video-layout';
|
||||||
|
|
||||||
import { FOLLOW_ME_COMMAND } from './constants';
|
import { FOLLOW_ME_COMMAND } from './constants';
|
||||||
|
import { isFollowMeActive } from './functions';
|
||||||
import logger from './logger';
|
import logger from './logger';
|
||||||
|
|
||||||
declare var APP: Object;
|
declare var APP: Object;
|
||||||
@ -111,7 +112,7 @@ function _onFollowMeCommand(attributes = {}, id, store) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!state['features/follow-me'].moderator) {
|
if (!isFollowMeActive(state)) {
|
||||||
store.dispatch(setFollowMeModerator(id));
|
store.dispatch(setFollowMeModerator(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import {
|
|||||||
getLocalParticipant,
|
getLocalParticipant,
|
||||||
isLocalParticipantModerator
|
isLocalParticipantModerator
|
||||||
} from '../base/participants';
|
} from '../base/participants';
|
||||||
|
import { isFollowMeActive } from '../follow-me';
|
||||||
|
|
||||||
declare var interfaceConfig: Object;
|
declare var interfaceConfig: Object;
|
||||||
|
|
||||||
@ -85,7 +86,7 @@ export function getMoreTabProps(stateful: Object | Function) {
|
|||||||
startAudioMutedPolicy,
|
startAudioMutedPolicy,
|
||||||
startVideoMutedPolicy
|
startVideoMutedPolicy
|
||||||
} = state['features/base/conference'];
|
} = state['features/base/conference'];
|
||||||
const followMeActive = Boolean(state['features/follow-me'].moderator);
|
const followMeActive = isFollowMeActive(state);
|
||||||
const configuredTabs = interfaceConfig.SETTINGS_SECTIONS || [];
|
const configuredTabs = interfaceConfig.SETTINGS_SECTIONS || [];
|
||||||
|
|
||||||
// The settings sections to display.
|
// The settings sections to display.
|
||||||
|
|||||||
@ -11,7 +11,9 @@ import {
|
|||||||
pinParticipant
|
pinParticipant
|
||||||
} from '../base/participants';
|
} from '../base/participants';
|
||||||
import { StateListenerRegistry, equals } from '../base/redux';
|
import { StateListenerRegistry, equals } from '../base/redux';
|
||||||
|
import { isFollowMeActive } from '../follow-me';
|
||||||
import { selectParticipant } from '../large-video';
|
import { selectParticipant } from '../large-video';
|
||||||
|
|
||||||
import { shouldDisplayTileView } from './functions';
|
import { shouldDisplayTileView } from './functions';
|
||||||
import { setParticipantsWithScreenShare } from './actions';
|
import { setParticipantsWithScreenShare } from './actions';
|
||||||
|
|
||||||
@ -48,12 +50,11 @@ StateListenerRegistry.register(
|
|||||||
StateListenerRegistry.register(
|
StateListenerRegistry.register(
|
||||||
/* selector */ state => state['features/base/tracks'],
|
/* selector */ state => state['features/base/tracks'],
|
||||||
/* listener */ debounce((tracks, store) => {
|
/* listener */ debounce((tracks, store) => {
|
||||||
if (!_getAutoPinSetting()) {
|
if (!_getAutoPinSetting() || isFollowMeActive(store)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const oldScreenSharesOrder
|
const oldScreenSharesOrder = store.getState()['features/video-layout'].screenShares || [];
|
||||||
= store.getState()['features/video-layout'].screenShares || [];
|
|
||||||
const knownSharingParticipantIds = tracks.reduce((acc, track) => {
|
const knownSharingParticipantIds = tracks.reduce((acc, track) => {
|
||||||
if (track.mediaType === 'video' && track.videoType === 'desktop') {
|
if (track.mediaType === 'video' && track.videoType === 'desktop') {
|
||||||
const skipTrack = _getAutoPinSetting() === 'remote-only' && track.local;
|
const skipTrack = _getAutoPinSetting() === 'remote-only' && track.local;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user