From 6943659dc9789bb898447737163ca2e62952233e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 25 Jul 2019 12:10:31 +0200 Subject: [PATCH] rn: enable auto-pinning on screenshare on mobile --- react/features/video-layout/subscriber.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/react/features/video-layout/subscriber.js b/react/features/video-layout/subscriber.js index ffb143a26..31acd333e 100644 --- a/react/features/video-layout/subscriber.js +++ b/react/features/video-layout/subscriber.js @@ -16,6 +16,10 @@ import { setParticipantsWithScreenShare } from './actions'; declare var APP: Object; declare var interfaceConfig: Object; +// TODO: interfaceConfig should be in redux so we didn't have to do this. +const AUTO_PIN_LATEST_SCREEN_SHARE + = typeof interfaceConfig === 'object' ? interfaceConfig.AUTO_PIN_LATEST_SCREEN_SHARE : 'remote-only'; + /** * StateListenerRegistry provides a reliable way of detecting changes to * preferred layout state and dispatching additional actions. @@ -31,8 +35,7 @@ StateListenerRegistry.register( dispatch( setMaxReceiverVideoQuality(VIDEO_QUALITY_LEVELS.HIGH)); - if (typeof interfaceConfig === 'object' - && interfaceConfig.AUTO_PIN_LATEST_SCREEN_SHARE) { + if (AUTO_PIN_LATEST_SCREEN_SHARE) { _updateAutoPinnedParticipant(store); } } @@ -46,8 +49,7 @@ StateListenerRegistry.register( StateListenerRegistry.register( /* selector */ state => state['features/base/tracks'], /* listener */ (tracks, store) => { - if (typeof interfaceConfig !== 'object' - || !interfaceConfig.AUTO_PIN_LATEST_SCREEN_SHARE) { + if (!AUTO_PIN_LATEST_SCREEN_SHARE) { return; } @@ -56,8 +58,7 @@ StateListenerRegistry.register( const knownSharingParticipantIds = tracks.reduce((acc, track) => { if (track.mediaType === 'video' && track.videoType === 'desktop') { const skipTrack - = interfaceConfig.AUTO_PIN_LATEST_SCREEN_SHARE === 'remote-only' - && track.local; + = AUTO_PIN_LATEST_SCREEN_SHARE === 'remote-only' && track.local; if (!skipTrack) { acc.push(track.participantId);