Skip to content

Commit

Permalink
Merge pull request #1123 from bgrozev/log-pinned
Browse files Browse the repository at this point in the history
Logs pinned/unpinned events
  • Loading branch information
damencho authored Nov 8, 2016
2 parents 38e4444 + 6740b9e commit b2d2209
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 20 deletions.
18 changes: 14 additions & 4 deletions conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ function disconnect() {
}

/**
* Set permanent ptoperties to analytics.
* NOTE: Has to be used after JitsiMeetJS.init. otherwise analytics will be
* Set permanent properties to analytics.
* NOTE: Has to be used after JitsiMeetJS.init. Otherwise analytics will be
* null.
*/
function setAnalyticsPermanentProperties() {
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 2 additions & 4 deletions modules/UI/toolbars/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,11 @@ const buttonHandlers = {
});
},
"toolbar_film_strip": function () {
JitsiMeetJS.analytics.sendEvent(
'toolbar.filmstrip.toggled');
JitsiMeetJS.analytics.sendEvent('toolbar.filmstrip.toggled');
emitter.emit(UIEvents.TOGGLE_FILM_STRIP);
},
"toolbar_button_raisehand": function () {
JitsiMeetJS.analytics.sendEvent(
'toolbar.raiseHand.clicked');
JitsiMeetJS.analytics.sendEvent('toolbar.raiseHand.clicked');
APP.conference.maybeToggleRaisedHand();
}
};
Expand Down
5 changes: 2 additions & 3 deletions modules/UI/videolayout/RemoteVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,10 @@ RemoteVideo.prototype.waitForPlayback = function (streamElement, stream) {

var self = this;

// Register 'onplaying' listener to trigger 'videoactive' on VideoLayout
// when video playback starts
// Triggers when video playback starts
var onPlayingHandler = function () {
self.wasVideoPlayed = true;
self.VideoLayout.videoactive(streamElement, self.id);
self.VideoLayout.remoteVideoActive(streamElement, self.id);
streamElement.onplaying = null;
// Refresh to show the video
self.updateView();
Expand Down
10 changes: 8 additions & 2 deletions modules/UI/videolayout/SmallVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,21 @@ SmallVideo.prototype.setDeviceAvailabilityIcons = function (devices) {

/**
* Sets the type of the video displayed by this instance.
* @param videoType 'camera' or 'desktop'
* Note that this is a string without clearly defined or checked values, and
* it is NOT one of the strings defined in service/RTC/VideoType in
* lib-jitsi-meet.
* @param videoType 'camera' or 'desktop', or 'sharedvideo'.
*/
SmallVideo.prototype.setVideoType = function (videoType) {
this.videoType = videoType;
};

/**
* Returns the type of the video displayed by this instance.
* @returns {String} 'camera', 'screen' or undefined.
* Note that this is a string without clearly defined or checked values, and
* it is NOT one of the strings defined in service/RTC/VideoType in
* lib-jitsi-meet.
* @returns {String} 'camera', 'screen', 'sharedvideo', or undefined.
*/
SmallVideo.prototype.getVideoType = function () {
return this.videoType;
Expand Down
14 changes: 7 additions & 7 deletions modules/UI/videolayout/VideoLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,11 @@ var VideoLayout = {
addRemoteVideoContainer (id, remoteVideo) {
remoteVideos[id] = remoteVideo;

let videoType = VideoLayout.getRemoteVideoType(id);
if (!videoType) {
if (!remoteVideo.getVideoType()) {
// make video type the default one (camera)
// FIXME container type is not a video type
videoType = VIDEO_CONTAINER_TYPE;
remoteVideo.setVideoType(VIDEO_CONTAINER_TYPE);
}
remoteVideo.setVideoType(videoType);

// In case this is not currently in the last n we don't show it.
if (localLastNCount && localLastNCount > 0 &&
Expand All @@ -425,12 +423,13 @@ var VideoLayout = {
remoteVideo.updateView();
},

videoactive (videoelem, resourceJid) {
// FIXME: what does this do???
remoteVideoActive(videoElement, resourceJid) {

console.info(resourceJid + " video is now active", videoelem);
console.info(resourceJid + " video is now active", videoElement);

VideoLayout.resizeThumbnails(
false, false, function() {$(videoelem).show();});
false, false, function() {$(videoElement).show();});

// Update the large video to the last added video only if there's no
// current dominant, focused speaker or update it to
Expand Down Expand Up @@ -623,6 +622,7 @@ var VideoLayout = {
// since we don't want to switch to local video.
// Update the large video if the video source is already available,
// otherwise wait for the "videoactive.jingle" event.
// FIXME: there is no "videoactive.jingle" event.
if (!pinnedId
&& remoteVideo.hasVideoStarted()
&& !this.getCurrentlyOnLargeContainer().stayOnStage()) {
Expand Down

0 comments on commit b2d2209

Please sign in to comment.