diff --git a/modules/UI/etherpad/Etherpad.js b/modules/UI/etherpad/Etherpad.js index f5f58f921..01979eb07 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. @@ -133,6 +133,13 @@ class Etherpad extends LargeContainer { }); }); } + + /** + * @return {boolean} do not switch on dominant speaker event if on stage. + */ + stayOnStage () { + return true; + } } /** @@ -159,7 +166,7 @@ export default class EtherpadManager { openEtherpad () { this.etherpad = new Etherpad(this.domain, this.name); VideoLayout.addLargeVideoContainer( - EtherpadContainerType, + ETHERPAD_CONTAINER_TYPE, this.etherpad ); } @@ -174,9 +181,10 @@ export default class EtherpadManager { } let isVisible = VideoLayout.isLargeContainerTypeVisible( - EtherpadContainerType + ETHERPAD_CONTAINER_TYPE ); - VideoLayout.showLargeVideoContainer(EtherpadContainerType, !isVisible); + VideoLayout.showLargeVideoContainer( + ETHERPAD_CONTAINER_TYPE, !isVisible); } } 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; },