From eefdbd4fe59589b369d9d68abf39a1048278db8f Mon Sep 17 00:00:00 2001 From: damencho Date: Thu, 17 Mar 2016 21:58:40 -0500 Subject: [PATCH 1/2] Renames EtherpadContainerType to ETHERPAD_CONTAINER_TYPE. --- modules/UI/etherpad/Etherpad.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/UI/etherpad/Etherpad.js b/modules/UI/etherpad/Etherpad.js index f5f58f921..b7feff895 100644 --- a/modules/UI/etherpad/Etherpad.js +++ b/modules/UI/etherpad/Etherpad.js @@ -52,7 +52,7 @@ const DEFAULT_WIDTH = 640; */ const DEFAULT_HEIGHT = 480; -const EtherpadContainerType = "etherpad"; +const ETHERPAD_CONTAINER_TYPE = "etherpad"; /** * Container for Etherpad iframe. @@ -159,7 +159,7 @@ export default class EtherpadManager { openEtherpad () { this.etherpad = new Etherpad(this.domain, this.name); VideoLayout.addLargeVideoContainer( - EtherpadContainerType, + ETHERPAD_CONTAINER_TYPE, this.etherpad ); } @@ -174,9 +174,10 @@ export default class EtherpadManager { } let isVisible = VideoLayout.isLargeContainerTypeVisible( - EtherpadContainerType + ETHERPAD_CONTAINER_TYPE ); - VideoLayout.showLargeVideoContainer(EtherpadContainerType, !isVisible); + VideoLayout.showLargeVideoContainer( + ETHERPAD_CONTAINER_TYPE, !isVisible); } } From 2b26580a7cc832d014a4a582a6238e3b89e51ef3 Mon Sep 17 00:00:00 2001 From: damencho Date: Thu, 17 Mar 2016 22:19:09 -0500 Subject: [PATCH 2/2] Disables switching to dominant speaker when Etherpad is shown on large video. --- modules/UI/etherpad/Etherpad.js | 7 +++++++ modules/UI/videolayout/LargeContainer.js | 7 +++++++ modules/UI/videolayout/LargeVideo.js | 7 +++++++ modules/UI/videolayout/VideoLayout.js | 12 +++++++++++- 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/modules/UI/etherpad/Etherpad.js b/modules/UI/etherpad/Etherpad.js index b7feff895..01979eb07 100644 --- a/modules/UI/etherpad/Etherpad.js +++ b/modules/UI/etherpad/Etherpad.js @@ -133,6 +133,13 @@ class Etherpad extends LargeContainer { }); }); } + + /** + * @return {boolean} do not switch on dominant speaker event if on stage. + */ + stayOnStage () { + return true; + } } /** diff --git a/modules/UI/videolayout/LargeContainer.js b/modules/UI/videolayout/LargeContainer.js index cc80f3f42..0f0dd242d 100644 --- a/modules/UI/videolayout/LargeContainer.js +++ b/modules/UI/videolayout/LargeContainer.js @@ -54,4 +54,11 @@ export default class LargeContainer { showAvatar (show) { } + /** + * Whether current container needs to be switched on dominant speaker event + * when the container is on stage. + * @return {boolean} + */ + stayOnStage () { + } } diff --git a/modules/UI/videolayout/LargeVideo.js b/modules/UI/videolayout/LargeVideo.js index 88d74cd65..494062af9 100644 --- a/modules/UI/videolayout/LargeVideo.js +++ b/modules/UI/videolayout/LargeVideo.js @@ -349,6 +349,13 @@ class VideoContainer extends LargeContainer { }); }); } + + /** + * @return {boolean} switch on dominant speaker event if on stage. + */ + stayOnStage () { + return false; + } } /** diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index 31adc8ae1..22e6e16ef 100644 --- a/modules/UI/videolayout/VideoLayout.js +++ b/modules/UI/videolayout/VideoLayout.js @@ -524,7 +524,9 @@ var VideoLayout = { // since we don't want to switch to local video. // Update the large video if the video source is already available, // otherwise wait for the "videoactive.jingle" event. - if (!focusedVideoResourceJid && remoteVideo.hasVideoStarted()) { + if (!focusedVideoResourceJid + && remoteVideo.hasVideoStarted() + && !this.getCurrentlyOnLargeContainer().stayOnStage()) { this.updateLargeVideo(id); } }, @@ -889,6 +891,14 @@ var VideoLayout = { return this.isLargeContainerTypeVisible(VideoContainerType); }, + /** + * @return {LargeContainer} the currently displayed container on large + * video. + */ + getCurrentlyOnLargeContainer () { + return largeVideo.getContainer(largeVideo.state); + }, + isCurrentlyOnLarge (id) { return largeVideo && largeVideo.id === id; },