From 6740b9edf6e7a3fb95ebd8dca6967e0f6ef1f058 Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Mon, 7 Nov 2016 21:36:10 -0600 Subject: [PATCH] feat: Logs pin/unpin events via analytics. --- conference.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/conference.js b/conference.js index 29c674cfa..c10274242 100644 --- a/conference.js +++ b/conference.js @@ -1437,11 +1437,21 @@ export default { }); APP.UI.addListener(UIEvents.PINNED_ENDPOINT, (smallVideo, isPinned) => { - var smallVideoId = smallVideo.getId(); + let smallVideoId = smallVideo.getId(); + let isLocal = APP.conference.isLocalId(smallVideoId); + + let eventName + = (isPinned ? "pinned" : "unpinned") + "." + + (isLocal ? "local" : "remote"); + let participantCount = room.getParticipantCount(); + JitsiMeetJS.analytics.sendEvent( + eventName, + { value: participantCount }); + // FIXME why VIDEO_CONTAINER_TYPE instead of checking if // the participant is on the large video ? if (smallVideo.getVideoType() === VIDEO_CONTAINER_TYPE - && !APP.conference.isLocalId(smallVideoId)) { + && !isLocal) { // When the library starts supporting multiple pins we would // pass the isPinned parameter together with the identifier,