From 4acfb033c880318065a75af881997deae5c8ec63 Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Thu, 15 Sep 2016 10:37:32 -0500 Subject: [PATCH 1/2] style(LargeVideo): Rename LARGE_VIDEO_AVATAR_DISPLAYED event --- modules/UI/ring_overlay/RingOverlay.js | 9 ++++++--- modules/UI/videolayout/VideoContainer.js | 2 +- service/UI/UIEvents.js | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/UI/ring_overlay/RingOverlay.js b/modules/UI/ring_overlay/RingOverlay.js index d7aa47e52..4fac6077c 100644 --- a/modules/UI/ring_overlay/RingOverlay.js +++ b/modules/UI/ring_overlay/RingOverlay.js @@ -9,7 +9,7 @@ import UIEvents from "../../../service/UI/UIEvents"; let overlay = null; /** - * Handler for UIEvents.LARGE_VIDEO_AVATAR_DISPLAYED event. + * Handler for UIEvents.LARGE_VIDEO_AVATAR_VISIBLE event. * @param {boolean} shown indicates whether the avatar on the large video is * currently displayed or not. */ @@ -112,6 +112,9 @@ class RingOverlay { $(`#${this._containerId}`).remove(); } + /** + * Stops the ringing and clears related timers. + */ _stopAudio() { if (this.interval) { clearInterval(this.interval); @@ -144,7 +147,7 @@ export default { } overlay = new RingOverlay(callee, disableRingingSound); - APP.UI.addListener(UIEvents.LARGE_VIDEO_AVATAR_DISPLAYED, + APP.UI.addListener(UIEvents.LARGE_VIDEO_AVATAR_VISIBLE, onAvatarDisplayed); }, @@ -158,7 +161,7 @@ export default { } overlay.destroy(); overlay = null; - APP.UI.removeListener(UIEvents.LARGE_VIDEO_AVATAR_DISPLAYED, + APP.UI.removeListener(UIEvents.LARGE_VIDEO_AVATAR_VISIBLE, onAvatarDisplayed); return true; }, diff --git a/modules/UI/videolayout/VideoContainer.js b/modules/UI/videolayout/VideoContainer.js index f59e43cc0..b91f6542d 100644 --- a/modules/UI/videolayout/VideoContainer.js +++ b/modules/UI/videolayout/VideoContainer.js @@ -397,7 +397,7 @@ export class VideoContainer extends LargeContainer { this.$avatar.css("visibility", show ? "visible" : "hidden"); this.avatarDisplayed = show; - this.emitter.emit(UIEvents.LARGE_VIDEO_AVATAR_DISPLAYED, show); + this.emitter.emit(UIEvents.LARGE_VIDEO_AVATAR_VISIBLE, show); } /** diff --git a/service/UI/UIEvents.js b/service/UI/UIEvents.js index b92f0b4d8..ed2b492e5 100644 --- a/service/UI/UIEvents.js +++ b/service/UI/UIEvents.js @@ -118,8 +118,8 @@ export default { /** * Notifies that the avatar is displayed or not on the largeVideo. */ - LARGE_VIDEO_AVATAR_DISPLAYED: "UI.large_video_avatar_displayed", - + LARGE_VIDEO_AVATAR_VISIBLE: "UI.large_video_avatar_visible", + /** * Toggling room lock */ From 58a07355fbc88d1e0c777a1a73b308de3a04223a Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Wed, 19 Oct 2016 15:58:36 -0500 Subject: [PATCH 2/2] style(RingOverlay): Rename onAvatarDisplayed to onAvatarVisible --- modules/UI/ring_overlay/RingOverlay.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/UI/ring_overlay/RingOverlay.js b/modules/UI/ring_overlay/RingOverlay.js index 4fac6077c..a59b83871 100644 --- a/modules/UI/ring_overlay/RingOverlay.js +++ b/modules/UI/ring_overlay/RingOverlay.js @@ -13,7 +13,7 @@ let overlay = null; * @param {boolean} shown indicates whether the avatar on the large video is * currently displayed or not. */ -function onAvatarDisplayed(shown) { +function onAvatarVisible(shown) { overlay._changeBackground(shown); } @@ -148,7 +148,7 @@ export default { overlay = new RingOverlay(callee, disableRingingSound); APP.UI.addListener(UIEvents.LARGE_VIDEO_AVATAR_VISIBLE, - onAvatarDisplayed); + onAvatarVisible); }, /** @@ -162,7 +162,7 @@ export default { overlay.destroy(); overlay = null; APP.UI.removeListener(UIEvents.LARGE_VIDEO_AVATAR_VISIBLE, - onAvatarDisplayed); + onAvatarVisible); return true; },