diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index d24a7447f..87e047d5a 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) {