From 5952261e876c220d482856ea3458a367fcf78c52 Mon Sep 17 00:00:00 2001 From: paweldomas Date: Sat, 24 Sep 2016 11:52:38 -0500 Subject: [PATCH] ref(LargeVideoManager): introduce 'setVideoConnectionMessage' --- modules/UI/videolayout/LargeVideoManager.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/modules/UI/videolayout/LargeVideoManager.js b/modules/UI/videolayout/LargeVideoManager.js index 251d7e1e6..ba5ee7264 100644 --- a/modules/UI/videolayout/LargeVideoManager.js +++ b/modules/UI/videolayout/LargeVideoManager.js @@ -92,10 +92,7 @@ export default class LargeVideoManager { */ onVideoInterrupted () { this.enableLocalConnectionProblemFilter(true); - let reconnectingKey = "connection.RECONNECTING"; - $('#videoConnectionMessage') - .attr("data-i18n", reconnectingKey) - .text(APP.translation.translateString(reconnectingKey)); + this._setVideoConnectionMessage("connection.RECONNECTING") // Show the message only if the video is currently being displayed this.showVideoConnectionMessage(this.state === VIDEO_CONTAINER_TYPE); } @@ -282,6 +279,21 @@ export default class LargeVideoManager { } } + /** + * Updated the text which is to be shown on the top of large video. + * + * @param {string} msgKey the translation key which will be used to get + * the message text to be displayed on the large video. + * @param {object} msgOptions translation options object + * + * @private + */ + _setVideoConnectionMessage (msgKey, msgOptions) { + $('#videoConnectionMessage') + .attr("data-i18n", msgKey) + .text(APP.translation.translateString(msgKey, msgOptions)); + } + /** * Add container of specified type. * @param {string} type container type