Переглянути джерело

Merge pull request #1123 from bgrozev/log-pinned

Logs pinned/unpinned events
master
Дамян Минков 8 роки тому
джерело
коміт
b2d2209236

+ 14
- 4
conference.js Переглянути файл

432
 }
432
 }
433
 
433
 
434
 /**
434
 /**
435
- * Set permanent ptoperties to analytics.
436
- * NOTE: Has to be used after JitsiMeetJS.init. otherwise analytics will be
435
+ * Set permanent properties to analytics.
436
+ * NOTE: Has to be used after JitsiMeetJS.init. Otherwise analytics will be
437
  * null.
437
  * null.
438
  */
438
  */
439
 function setAnalyticsPermanentProperties() {
439
 function setAnalyticsPermanentProperties() {
1437
         });
1437
         });
1438
 
1438
 
1439
         APP.UI.addListener(UIEvents.PINNED_ENDPOINT, (smallVideo, isPinned) => {
1439
         APP.UI.addListener(UIEvents.PINNED_ENDPOINT, (smallVideo, isPinned) => {
1440
-            var smallVideoId = smallVideo.getId();
1440
+            let smallVideoId = smallVideo.getId();
1441
+            let isLocal = APP.conference.isLocalId(smallVideoId);
1442
+
1443
+            let eventName
1444
+                = (isPinned ? "pinned" : "unpinned") + "." +
1445
+                        (isLocal ? "local" : "remote");
1446
+            let participantCount = room.getParticipantCount();
1447
+            JitsiMeetJS.analytics.sendEvent(
1448
+                    eventName,
1449
+                    { value: participantCount });
1450
+
1441
             // FIXME why VIDEO_CONTAINER_TYPE instead of checking if
1451
             // FIXME why VIDEO_CONTAINER_TYPE instead of checking if
1442
             // the participant is on the large video ?
1452
             // the participant is on the large video ?
1443
             if (smallVideo.getVideoType() === VIDEO_CONTAINER_TYPE
1453
             if (smallVideo.getVideoType() === VIDEO_CONTAINER_TYPE
1444
-                && !APP.conference.isLocalId(smallVideoId)) {
1454
+                && !isLocal) {
1445
 
1455
 
1446
                 // When the library starts supporting multiple pins we would
1456
                 // When the library starts supporting multiple pins we would
1447
                 // pass the isPinned parameter together with the identifier,
1457
                 // pass the isPinned parameter together with the identifier,

+ 2
- 4
modules/UI/toolbars/Toolbar.js Переглянути файл

118
         });
118
         });
119
     },
119
     },
120
     "toolbar_film_strip": function () {
120
     "toolbar_film_strip": function () {
121
-        JitsiMeetJS.analytics.sendEvent(
122
-            'toolbar.filmstrip.toggled');
121
+        JitsiMeetJS.analytics.sendEvent('toolbar.filmstrip.toggled');
123
         emitter.emit(UIEvents.TOGGLE_FILM_STRIP);
122
         emitter.emit(UIEvents.TOGGLE_FILM_STRIP);
124
     },
123
     },
125
     "toolbar_button_raisehand": function () {
124
     "toolbar_button_raisehand": function () {
126
-        JitsiMeetJS.analytics.sendEvent(
127
-            'toolbar.raiseHand.clicked');
125
+        JitsiMeetJS.analytics.sendEvent('toolbar.raiseHand.clicked');
128
         APP.conference.maybeToggleRaisedHand();
126
         APP.conference.maybeToggleRaisedHand();
129
     }
127
     }
130
 };
128
 };

+ 2
- 3
modules/UI/videolayout/RemoteVideo.js Переглянути файл

440
 
440
 
441
     var self = this;
441
     var self = this;
442
 
442
 
443
-    // Register 'onplaying' listener to trigger 'videoactive' on VideoLayout
444
-    // when video playback starts
443
+    // Triggers when video playback starts
445
     var onPlayingHandler = function () {
444
     var onPlayingHandler = function () {
446
         self.wasVideoPlayed = true;
445
         self.wasVideoPlayed = true;
447
-        self.VideoLayout.videoactive(streamElement, self.id);
446
+        self.VideoLayout.remoteVideoActive(streamElement, self.id);
448
         streamElement.onplaying = null;
447
         streamElement.onplaying = null;
449
         // Refresh to show the video
448
         // Refresh to show the video
450
         self.updateView();
449
         self.updateView();

+ 8
- 2
modules/UI/videolayout/SmallVideo.js Переглянути файл

120
 
120
 
121
 /**
121
 /**
122
  * Sets the type of the video displayed by this instance.
122
  * Sets the type of the video displayed by this instance.
123
- * @param videoType 'camera' or 'desktop'
123
+ * Note that this is a string without clearly defined or checked values, and
124
+ * it is NOT one of the strings defined in service/RTC/VideoType in
125
+ * lib-jitsi-meet.
126
+ * @param videoType 'camera' or 'desktop', or 'sharedvideo'.
124
  */
127
  */
125
 SmallVideo.prototype.setVideoType = function (videoType) {
128
 SmallVideo.prototype.setVideoType = function (videoType) {
126
     this.videoType = videoType;
129
     this.videoType = videoType;
128
 
131
 
129
 /**
132
 /**
130
  * Returns the type of the video displayed by this instance.
133
  * Returns the type of the video displayed by this instance.
131
- * @returns {String} 'camera', 'screen' or undefined.
134
+ * Note that this is a string without clearly defined or checked values, and
135
+ * it is NOT one of the strings defined in service/RTC/VideoType in
136
+ * lib-jitsi-meet.
137
+ * @returns {String} 'camera', 'screen', 'sharedvideo', or undefined.
132
  */
138
  */
133
 SmallVideo.prototype.getVideoType = function () {
139
 SmallVideo.prototype.getVideoType = function () {
134
     return this.videoType;
140
     return this.videoType;

+ 7
- 7
modules/UI/videolayout/VideoLayout.js Переглянути файл

406
     addRemoteVideoContainer (id, remoteVideo) {
406
     addRemoteVideoContainer (id, remoteVideo) {
407
         remoteVideos[id] = remoteVideo;
407
         remoteVideos[id] = remoteVideo;
408
 
408
 
409
-        let videoType = VideoLayout.getRemoteVideoType(id);
410
-        if (!videoType) {
409
+        if (!remoteVideo.getVideoType()) {
411
             // make video type the default one (camera)
410
             // make video type the default one (camera)
412
             // FIXME container type is not a video type
411
             // FIXME container type is not a video type
413
-            videoType = VIDEO_CONTAINER_TYPE;
412
+            remoteVideo.setVideoType(VIDEO_CONTAINER_TYPE);
414
         }
413
         }
415
-        remoteVideo.setVideoType(videoType);
416
 
414
 
417
         // In case this is not currently in the last n we don't show it.
415
         // In case this is not currently in the last n we don't show it.
418
         if (localLastNCount && localLastNCount > 0 &&
416
         if (localLastNCount && localLastNCount > 0 &&
425
         remoteVideo.updateView();
423
         remoteVideo.updateView();
426
     },
424
     },
427
 
425
 
428
-    videoactive (videoelem, resourceJid) {
426
+    // FIXME: what does this do???
427
+    remoteVideoActive(videoElement, resourceJid) {
429
 
428
 
430
-        console.info(resourceJid + " video is now active", videoelem);
429
+        console.info(resourceJid + " video is now active", videoElement);
431
 
430
 
432
         VideoLayout.resizeThumbnails(
431
         VideoLayout.resizeThumbnails(
433
-            false, false, function() {$(videoelem).show();});
432
+            false, false, function() {$(videoElement).show();});
434
 
433
 
435
         // Update the large video to the last added video only if there's no
434
         // Update the large video to the last added video only if there's no
436
         // current dominant, focused speaker or update it to
435
         // current dominant, focused speaker or update it to
623
         // since we don't want to switch to local video.
622
         // since we don't want to switch to local video.
624
         // Update the large video if the video source is already available,
623
         // Update the large video if the video source is already available,
625
         // otherwise wait for the "videoactive.jingle" event.
624
         // otherwise wait for the "videoactive.jingle" event.
625
+        // FIXME: there is no "videoactive.jingle" event.
626
         if (!pinnedId
626
         if (!pinnedId
627
             && remoteVideo.hasVideoStarted()
627
             && remoteVideo.hasVideoStarted()
628
             && !this.getCurrentlyOnLargeContainer().stayOnStage()) {
628
             && !this.getCurrentlyOnLargeContainer().stayOnStage()) {

Завантаження…
Відмінити
Зберегти