Merge pull request #1123 from bgrozev/log-pinned

Logs pinned/unpinned events
This commit is contained in:
Дамян Минков 2016-11-08 10:16:01 -06:00 committed by GitHub
commit b2d2209236
5 changed files with 33 additions and 20 deletions

View File

@ -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() {
@ -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,

View File

@ -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();
}
};

View File

@ -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();

View File

@ -120,7 +120,10 @@ 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;
@ -128,7 +131,10 @@ SmallVideo.prototype.setVideoType = function (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;

View File

@ -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 &&
@ -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
@ -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()) {