From 6211566c0c10bf0e438add80e8c6b9d4f941fac8 Mon Sep 17 00:00:00 2001 From: damencho Date: Wed, 23 Nov 2016 17:02:24 -0600 Subject: [PATCH] Sending unpin after clicking local video and unpinning remote. If we: - pin a remote and click it, unpin is signalled. - pin a remote and the click another remote, the new one is pinned and signalled. - pin a remote and then click local. UI pins local, but unpinning remote is not signaled, fix addressed with this commit. - pin/unpin local, nothing is signalled. --- modules/UI/videolayout/VideoLayout.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index 65f1313874..8a53682eeb 100644 --- a/modules/UI/videolayout/VideoLayout.js +++ b/modules/UI/videolayout/VideoLayout.js @@ -341,14 +341,20 @@ var VideoLayout = { * @param id the identifier of the video thumbnail */ handleVideoThumbClicked (id) { + var smallVideo = VideoLayout.getSmallVideo(id); if(pinnedId) { var oldSmallVideo = VideoLayout.getSmallVideo(pinnedId); - if (oldSmallVideo && !interfaceConfig.filmStripOnly) + if (oldSmallVideo && !interfaceConfig.filmStripOnly) { oldSmallVideo.focus(false); + // as no pinned event will be sent for local video + // and we will unpin old one, lets signal it + // otherwise we will just send the new pinned one + if (smallVideo.isLocal) + eventEmitter.emit( + UIEvents.PINNED_ENDPOINT, oldSmallVideo, false); + } } - var smallVideo = VideoLayout.getSmallVideo(id); - // Unpin if currently pinned. if (pinnedId === id) {