Bläddra i källkod

Merge pull request #1123 from bgrozev/log-pinned

Logs pinned/unpinned events
master
Дамян Минков 8 år sedan
förälder
incheckning
b2d2209236

+ 14
- 4
conference.js Visa fil

@@ -432,8 +432,8 @@ function disconnect() {
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 437
  * null.
438 438
  */
439 439
 function setAnalyticsPermanentProperties() {
@@ -1437,11 +1437,21 @@ export default {
1437 1437
         });
1438 1438
 
1439 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 1451
             // FIXME why VIDEO_CONTAINER_TYPE instead of checking if
1442 1452
             // the participant is on the large video ?
1443 1453
             if (smallVideo.getVideoType() === VIDEO_CONTAINER_TYPE
1444
-                && !APP.conference.isLocalId(smallVideoId)) {
1454
+                && !isLocal) {
1445 1455
 
1446 1456
                 // When the library starts supporting multiple pins we would
1447 1457
                 // pass the isPinned parameter together with the identifier,

+ 2
- 4
modules/UI/toolbars/Toolbar.js Visa fil

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

+ 2
- 3
modules/UI/videolayout/RemoteVideo.js Visa fil

@@ -440,11 +440,10 @@ RemoteVideo.prototype.waitForPlayback = function (streamElement, stream) {
440 440
 
441 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 444
     var onPlayingHandler = function () {
446 445
         self.wasVideoPlayed = true;
447
-        self.VideoLayout.videoactive(streamElement, self.id);
446
+        self.VideoLayout.remoteVideoActive(streamElement, self.id);
448 447
         streamElement.onplaying = null;
449 448
         // Refresh to show the video
450 449
         self.updateView();

+ 8
- 2
modules/UI/videolayout/SmallVideo.js Visa fil

@@ -120,7 +120,10 @@ SmallVideo.prototype.setDeviceAvailabilityIcons = function (devices) {
120 120
 
121 121
 /**
122 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 128
 SmallVideo.prototype.setVideoType = function (videoType) {
126 129
     this.videoType = videoType;
@@ -128,7 +131,10 @@ SmallVideo.prototype.setVideoType = function (videoType) {
128 131
 
129 132
 /**
130 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 139
 SmallVideo.prototype.getVideoType = function () {
134 140
     return this.videoType;

+ 7
- 7
modules/UI/videolayout/VideoLayout.js Visa fil

@@ -406,13 +406,11 @@ var VideoLayout = {
406 406
     addRemoteVideoContainer (id, remoteVideo) {
407 407
         remoteVideos[id] = remoteVideo;
408 408
 
409
-        let videoType = VideoLayout.getRemoteVideoType(id);
410
-        if (!videoType) {
409
+        if (!remoteVideo.getVideoType()) {
411 410
             // make video type the default one (camera)
412 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 415
         // In case this is not currently in the last n we don't show it.
418 416
         if (localLastNCount && localLastNCount > 0 &&
@@ -425,12 +423,13 @@ var VideoLayout = {
425 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 431
         VideoLayout.resizeThumbnails(
433
-            false, false, function() {$(videoelem).show();});
432
+            false, false, function() {$(videoElement).show();});
434 433
 
435 434
         // Update the large video to the last added video only if there's no
436 435
         // current dominant, focused speaker or update it to
@@ -623,6 +622,7 @@ var VideoLayout = {
623 622
         // since we don't want to switch to local video.
624 623
         // Update the large video if the video source is already available,
625 624
         // otherwise wait for the "videoactive.jingle" event.
625
+        // FIXME: there is no "videoactive.jingle" event.
626 626
         if (!pinnedId
627 627
             && remoteVideo.hasVideoStarted()
628 628
             && !this.getCurrentlyOnLargeContainer().stayOnStage()) {

Laddar…
Avbryt
Spara