From 794713b930ffc20ecdfa66a83b1f0b1632e7309a Mon Sep 17 00:00:00 2001 From: Jaya Allamsetty <54324652+jallamsetty1@users.noreply.github.com> Date: Mon, 21 Sep 2020 19:54:45 -0400 Subject: [PATCH] fix(iFrame): Make resizeLargeVideo only available on web --- modules/UI/videolayout/LargeVideoManager.js | 2 +- .../{actions.js => actions.any.js} | 24 ---------------- react/features/large-video/actions.native.js | 3 ++ react/features/large-video/actions.web.js | 28 +++++++++++++++++++ react/features/video-layout/subscriber.js | 2 +- 5 files changed, 33 insertions(+), 26 deletions(-) rename react/features/large-video/{actions.js => actions.any.js} (90%) create mode 100644 react/features/large-video/actions.native.js create mode 100644 react/features/large-video/actions.web.js diff --git a/modules/UI/videolayout/LargeVideoManager.js b/modules/UI/videolayout/LargeVideoManager.js index 98f236b39..271cd6994 100644 --- a/modules/UI/videolayout/LargeVideoManager.js +++ b/modules/UI/videolayout/LargeVideoManager.js @@ -15,7 +15,7 @@ import { VIDEO_TYPE } from '../../../react/features/base/media'; import { CHAT_SIZE } from '../../../react/features/chat'; import { updateKnownLargeVideoResolution -} from '../../../react/features/large-video'; +} from '../../../react/features/large-video/actions'; import { PresenceLabel } from '../../../react/features/presence-status'; /* eslint-enable no-unused-vars */ import UIEvents from '../../../service/UI/UIEvents'; diff --git a/react/features/large-video/actions.js b/react/features/large-video/actions.any.js similarity index 90% rename from react/features/large-video/actions.js rename to react/features/large-video/actions.any.js index f34a8e1f0..3f787329c 100644 --- a/react/features/large-video/actions.js +++ b/react/features/large-video/actions.any.js @@ -2,7 +2,6 @@ import type { Dispatch } from 'redux'; -import VideoLayout from '../../../modules/UI/videolayout/VideoLayout'; import { createSelectParticipantFailedEvent, sendAnalytics @@ -19,8 +18,6 @@ import { UPDATE_KNOWN_LARGE_VIDEO_RESOLUTION } from './actionTypes'; -declare var APP: Object; - /** * Captures a screenshot of the video displayed on the large video. * @@ -72,27 +69,6 @@ export function captureLargeVideoScreenshot() { }; } -/** - * Resizes the large video container based on the dimensions provided. - * - * @param {number} width - Width that needs to be applied on the large video container. - * @param {number} height - Height that needs to be applied on the large video container. - * @returns {Function} - */ -export function resizeLargeVideo(width: number, height: number) { - return (dispatch: Dispatch, getState: Function) => { - const state = getState(); - const largeVideo = state['features/large-video']; - - if (largeVideo) { - const largeVideoContainer = VideoLayout.getLargeVideo(); - - largeVideoContainer.updateContainerSize(width, height); - largeVideoContainer.resize(); - } - }; -} - /** * Signals conference to select a participant. * diff --git a/react/features/large-video/actions.native.js b/react/features/large-video/actions.native.js new file mode 100644 index 000000000..7e5279fe7 --- /dev/null +++ b/react/features/large-video/actions.native.js @@ -0,0 +1,3 @@ +// @flow + +export * from './actions.any'; diff --git a/react/features/large-video/actions.web.js b/react/features/large-video/actions.web.js new file mode 100644 index 000000000..bf3634021 --- /dev/null +++ b/react/features/large-video/actions.web.js @@ -0,0 +1,28 @@ +// @flow + +import type { Dispatch } from 'redux'; + +import VideoLayout from '../../../modules/UI/videolayout/VideoLayout'; + +export * from './actions.any'; + +/** + * Resizes the large video container based on the dimensions provided. + * + * @param {number} width - Width that needs to be applied on the large video container. + * @param {number} height - Height that needs to be applied on the large video container. + * @returns {Function} + */ +export function resizeLargeVideo(width: number, height: number) { + return (dispatch: Dispatch, getState: Function) => { + const state = getState(); + const largeVideo = state['features/large-video']; + + if (largeVideo) { + const largeVideoContainer = VideoLayout.getLargeVideo(); + + largeVideoContainer.updateContainerSize(width, height); + largeVideoContainer.resize(); + } + }; +} diff --git a/react/features/video-layout/subscriber.js b/react/features/video-layout/subscriber.js index 1590e57a6..eecdfab93 100644 --- a/react/features/video-layout/subscriber.js +++ b/react/features/video-layout/subscriber.js @@ -5,7 +5,7 @@ import debounce from 'lodash/debounce'; import { pinParticipant, getPinnedParticipant } from '../base/participants'; import { StateListenerRegistry, equals } from '../base/redux'; import { isFollowMeActive } from '../follow-me'; -import { selectParticipant } from '../large-video'; +import { selectParticipant } from '../large-video/actions'; import { setParticipantsWithScreenShare } from './actions';