Moves loading of analytics in the library.

This commit is contained in:
damencho 2016-08-09 15:04:40 -05:00
parent a50a980de4
commit 536ffb31e0
10 changed files with 72 additions and 89 deletions

View File

@ -13,7 +13,6 @@ import CQEvents from './service/connectionquality/CQEvents';
import UIEvents from './service/UI/UIEvents'; import UIEvents from './service/UI/UIEvents';
import mediaDeviceHelper from './modules/devices/mediaDeviceHelper'; import mediaDeviceHelper from './modules/devices/mediaDeviceHelper';
import AnalyticsAdapter from './modules/statistics/AnalyticsAdapter';
import {reportError} from './modules/util/helpers'; import {reportError} from './modules/util/helpers';
@ -896,7 +895,8 @@ export default {
return this.useVideoStream(stream); return this.useVideoStream(stream);
}).then(() => { }).then(() => {
this.videoSwitchInProgress = false; this.videoSwitchInProgress = false;
AnalyticsAdapter.sendEvent('conference.sharingDesktop.start'); JitsiMeetJS.analytics.sendEvent(
'conference.sharingDesktop.start');
console.log('sharing local desktop'); console.log('sharing local desktop');
}).catch((err) => { }).catch((err) => {
this.videoSwitchInProgress = false; this.videoSwitchInProgress = false;
@ -942,7 +942,8 @@ export default {
([stream]) => this.useVideoStream(stream) ([stream]) => this.useVideoStream(stream)
).then(() => { ).then(() => {
this.videoSwitchInProgress = false; this.videoSwitchInProgress = false;
AnalyticsAdapter.sendEvent('conference.sharingDesktop.stop'); JitsiMeetJS.analytics.sendEvent(
'conference.sharingDesktop.stop');
console.log('sharing local video'); console.log('sharing local video');
}).catch((err) => { }).catch((err) => {
this.useVideoStream(null); this.useVideoStream(null);
@ -1306,7 +1307,7 @@ export default {
try { try {
room.selectParticipant(id); room.selectParticipant(id);
} catch (e) { } catch (e) {
AnalyticsAdapter.sendEvent('selectParticipant.failed'); JitsiMeetJS.analytics.sendEvent('selectParticipant.failed');
reportError(e); reportError(e);
} }
}); });
@ -1331,7 +1332,7 @@ export default {
APP.UI.addListener( APP.UI.addListener(
UIEvents.VIDEO_DEVICE_CHANGED, UIEvents.VIDEO_DEVICE_CHANGED,
(cameraDeviceId) => { (cameraDeviceId) => {
AnalyticsAdapter.sendEvent('settings.changeDevice.video'); JitsiMeetJS.analytics.sendEvent('settings.changeDevice.video');
createLocalTracks({ createLocalTracks({
devices: ['video'], devices: ['video'],
cameraDeviceId: cameraDeviceId, cameraDeviceId: cameraDeviceId,
@ -1352,7 +1353,8 @@ export default {
APP.UI.addListener( APP.UI.addListener(
UIEvents.AUDIO_DEVICE_CHANGED, UIEvents.AUDIO_DEVICE_CHANGED,
(micDeviceId) => { (micDeviceId) => {
AnalyticsAdapter.sendEvent('settings.changeDevice.audioIn'); JitsiMeetJS.analytics.sendEvent(
'settings.changeDevice.audioIn');
createLocalTracks({ createLocalTracks({
devices: ['audio'], devices: ['audio'],
cameraDeviceId: null, cameraDeviceId: null,
@ -1373,7 +1375,8 @@ export default {
APP.UI.addListener( APP.UI.addListener(
UIEvents.AUDIO_OUTPUT_DEVICE_CHANGED, UIEvents.AUDIO_OUTPUT_DEVICE_CHANGED,
(audioOutputDeviceId) => { (audioOutputDeviceId) => {
AnalyticsAdapter.sendEvent('settings.changeDevice.audioOut'); JitsiMeetJS.analytics.sendEvent(
'settings.changeDevice.audioOut');
APP.settings.setAudioOutputDeviceId(audioOutputDeviceId) APP.settings.setAudioOutputDeviceId(audioOutputDeviceId)
.then(() => console.log('changed audio output device')) .then(() => console.log('changed audio output device'))
.catch((err) => { .catch((err) => {

View File

@ -1,6 +1,5 @@
/* global $, APP, config, interfaceConfig */ /* global $, APP, config, interfaceConfig, JitsiMeetJS */
import UIEvents from "../../service/UI/UIEvents"; import UIEvents from "../../service/UI/UIEvents";
import AnalyticsAdapter from '../statistics/AnalyticsAdapter';
/** /**
* Constructs the html for the overall feedback window. * Constructs the html for the overall feedback window.
@ -201,7 +200,7 @@ var Feedback = {
= document.getElementById("feedbackTextArea").value; = document.getElementById("feedbackTextArea").value;
if (feedbackDetails && feedbackDetails.length > 0) { if (feedbackDetails && feedbackDetails.length > 0) {
AnalyticsAdapter.sendEvent( JitsiMeetJS.analytics.sendEvent(
'feedback.rating', Feedback.feedbackScore); 'feedback.rating', Feedback.feedbackScore);
APP.conference.sendFeedback( Feedback.feedbackScore, APP.conference.sendFeedback( Feedback.feedbackScore,
feedbackDetails); feedbackDetails);
@ -231,7 +230,7 @@ var Feedback = {
closeText: '', closeText: '',
loaded: onLoadFunction, loaded: onLoadFunction,
position: {width: 500}}, null); position: {width: 500}}, null);
AnalyticsAdapter.sendEvent('feedback.open'); JitsiMeetJS.analytics.sendEvent('feedback.open');
}, },
/** /**
* Toggles the appropriate css class for the given number of stars, to * Toggles the appropriate css class for the given number of stars, to

View File

@ -1,7 +1,5 @@
/* global APP, JitsiMeetJS */ /* global APP, JitsiMeetJS */
import UIUtil from '../util/UIUtil'; import UIUtil from '../util/UIUtil';
//FIXME:
import AnalyticsAdapter from '../../statistics/AnalyticsAdapter';
/** /**
* Show dialog which asks user for new password for the conference. * Show dialog which asks user for new password for the conference.
@ -152,7 +150,7 @@ export default function createRoomLocker (room) {
return askToUnlock().then( return askToUnlock().then(
() => { return lock(); } () => { return lock(); }
).then(function () { ).then(function () {
AnalyticsAdapter.sendEvent('toolbar.lock.disabled'); JitsiMeetJS.analytics.sendEvent('toolbar.lock.disabled');
}).catch( }).catch(
reason => { reason => {
if (reason !== APP.UI.messageHandler.CANCEL) if (reason !== APP.UI.messageHandler.CANCEL)
@ -170,7 +168,7 @@ export default function createRoomLocker (room) {
return askForNewPassword().then( return askForNewPassword().then(
newPass => { return lock(newPass);} newPass => { return lock(newPass);}
).then(function () { ).then(function () {
AnalyticsAdapter.sendEvent('toolbar.lock.enabled'); JitsiMeetJS.analytics.sendEvent('toolbar.lock.enabled');
}).catch( }).catch(
reason => { reason => {
if (reason !== APP.UI.messageHandler.CANCEL) if (reason !== APP.UI.messageHandler.CANCEL)

View File

@ -1,4 +1,4 @@
/* global APP, $, config, interfaceConfig */ /* global APP, $, config, interfaceConfig, JitsiMeetJS */
/* /*
* Copyright @ 2015 Atlassian Pty Ltd * Copyright @ 2015 Atlassian Pty Ltd
* *
@ -20,7 +20,6 @@ import VideoLayout from '../videolayout/VideoLayout';
import Feedback from '../Feedback.js'; import Feedback from '../Feedback.js';
import Toolbar from '../toolbars/Toolbar'; import Toolbar from '../toolbars/Toolbar';
import BottomToolbar from '../toolbars/BottomToolbar'; import BottomToolbar from '../toolbars/BottomToolbar';
import AnalyticsAdapter from '../../statistics/AnalyticsAdapter';
/** /**
* The dialog for user input. * The dialog for user input.
@ -307,7 +306,7 @@ var Recording = {
selector.click(function () { selector.click(function () {
if (dialog) if (dialog)
return; return;
AnalyticsAdapter.sendEvent('recording.clicked'); JitsiMeetJS.analytics.sendEvent('recording.clicked');
switch (self.currentState) { switch (self.currentState) {
case Status.ON: case Status.ON:
case Status.RETRYING: case Status.RETRYING:
@ -315,7 +314,8 @@ var Recording = {
_showStopRecordingPrompt(recordingType).then( _showStopRecordingPrompt(recordingType).then(
() => { () => {
self.eventEmitter.emit(UIEvents.RECORDING_TOGGLED); self.eventEmitter.emit(UIEvents.RECORDING_TOGGLED);
AnalyticsAdapter.sendEvent('recording.stopped'); JitsiMeetJS.analytics.sendEvent(
'recording.stopped');
}, },
() => {}); () => {});
break; break;
@ -326,13 +326,14 @@ var Recording = {
_requestLiveStreamId().then((streamId) => { _requestLiveStreamId().then((streamId) => {
self.eventEmitter.emit( UIEvents.RECORDING_TOGGLED, self.eventEmitter.emit( UIEvents.RECORDING_TOGGLED,
{streamId: streamId}); {streamId: streamId});
AnalyticsAdapter.sendEvent('recording.started'); JitsiMeetJS.analytics.sendEvent(
'recording.started');
}).catch( }).catch(
reason => { reason => {
if (reason !== APP.UI.messageHandler.CANCEL) if (reason !== APP.UI.messageHandler.CANCEL)
console.error(reason); console.error(reason);
else else
AnalyticsAdapter.sendEvent( JitsiMeetJS.analytics.sendEvent(
'recording.canceled'); 'recording.canceled');
} }
); );
@ -340,20 +341,22 @@ var Recording = {
if (self.predefinedToken) { if (self.predefinedToken) {
self.eventEmitter.emit( UIEvents.RECORDING_TOGGLED, self.eventEmitter.emit( UIEvents.RECORDING_TOGGLED,
{token: self.predefinedToken}); {token: self.predefinedToken});
AnalyticsAdapter.sendEvent('recording.started'); JitsiMeetJS.analytics.sendEvent(
'recording.started');
return; return;
} }
_requestRecordingToken().then((token) => { _requestRecordingToken().then((token) => {
self.eventEmitter.emit( UIEvents.RECORDING_TOGGLED, self.eventEmitter.emit( UIEvents.RECORDING_TOGGLED,
{token: token}); {token: token});
AnalyticsAdapter.sendEvent('recording.started'); JitsiMeetJS.analytics.sendEvent(
'recording.started');
}).catch( }).catch(
reason => { reason => {
if (reason !== APP.UI.messageHandler.CANCEL) if (reason !== APP.UI.messageHandler.CANCEL)
console.error(reason); console.error(reason);
else else
AnalyticsAdapter.sendEvent( JitsiMeetJS.analytics.sendEvent(
'recording.canceled'); 'recording.canceled');
} }
); );

View File

@ -1,4 +1,5 @@
/* global $, APP, YT, onPlayerReady, onPlayerStateChange, onPlayerError */ /* global $, APP, YT, onPlayerReady, onPlayerStateChange, onPlayerError,
JitsiMeetJS */
import UIUtil from '../util/UIUtil'; import UIUtil from '../util/UIUtil';
import UIEvents from '../../../service/UI/UIEvents'; import UIEvents from '../../../service/UI/UIEvents';
@ -8,7 +9,6 @@ import LargeContainer from '../videolayout/LargeContainer';
import SmallVideo from '../videolayout/SmallVideo'; import SmallVideo from '../videolayout/SmallVideo';
import FilmStrip from '../videolayout/FilmStrip'; import FilmStrip from '../videolayout/FilmStrip';
import ToolbarToggler from "../toolbars/ToolbarToggler"; import ToolbarToggler from "../toolbars/ToolbarToggler";
import AnalyticsAdapter from '../../statistics/AnalyticsAdapter';
export const SHARED_VIDEO_CONTAINER_TYPE = "sharedvideo"; export const SHARED_VIDEO_CONTAINER_TYPE = "sharedvideo";
@ -72,11 +72,11 @@ export default class SharedVideoManager {
url => { url => {
this.emitter.emit( this.emitter.emit(
UIEvents.UPDATE_SHARED_VIDEO, url, 'start'); UIEvents.UPDATE_SHARED_VIDEO, url, 'start');
AnalyticsAdapter.sendEvent('sharedvideo.started'); JitsiMeetJS.analytics.sendEvent('sharedvideo.started');
}, },
err => { err => {
console.log('SHARED VIDEO CANCELED', err); console.log('SHARED VIDEO CANCELED', err);
AnalyticsAdapter.sendEvent('sharedvideo.canceled'); JitsiMeetJS.analytics.sendEvent('sharedvideo.canceled');
} }
); );
return; return;
@ -86,7 +86,7 @@ export default class SharedVideoManager {
showStopVideoPropmpt().then(() => { showStopVideoPropmpt().then(() => {
this.emitter.emit( this.emitter.emit(
UIEvents.UPDATE_SHARED_VIDEO, this.url, 'stop'); UIEvents.UPDATE_SHARED_VIDEO, this.url, 'stop');
AnalyticsAdapter.sendEvent('sharedvideo.stoped'); JitsiMeetJS.analytics.sendEvent('sharedvideo.stoped');
}, },
() => {}); () => {});
} else { } else {
@ -98,7 +98,7 @@ export default class SharedVideoManager {
dialog = null; dialog = null;
} }
); );
AnalyticsAdapter.sendEvent('sharedvideo.alreadyshared'); JitsiMeetJS.analytics.sendEvent('sharedvideo.alreadyshared');
} }
} }
@ -202,7 +202,7 @@ export default class SharedVideoManager {
self.smartAudioMute(); self.smartAudioMute();
} else if (event.data == YT.PlayerState.PAUSED) { } else if (event.data == YT.PlayerState.PAUSED) {
self.smartAudioUnmute(); self.smartAudioUnmute();
AnalyticsAdapter.sendEvent('sharedvideo.paused'); JitsiMeetJS.analytics.sendEvent('sharedvideo.paused');
} }
self.fireSharedVideoEvent(event.data == YT.PlayerState.PAUSED); self.fireSharedVideoEvent(event.data == YT.PlayerState.PAUSED);
}; };
@ -232,7 +232,7 @@ export default class SharedVideoManager {
else if (event.data.volume <=0 || event.data.muted) { else if (event.data.volume <=0 || event.data.muted) {
self.smartAudioUnmute(); self.smartAudioUnmute();
} }
AnalyticsAdapter.sendEvent('sharedvideo.volumechanged'); JitsiMeetJS.analytics.sendEvent('sharedvideo.volumechanged');
}; };
window.onPlayerReady = function(event) { window.onPlayerReady = function(event) {

View File

@ -1,7 +1,6 @@
/* global $, APP, interfaceConfig*/ /* global $, APP, interfaceConfig, JitsiMeetJS */
import UIUtil from '../util/UIUtil'; import UIUtil from '../util/UIUtil';
import UIEvents from '../../../service/UI/UIEvents'; import UIEvents from '../../../service/UI/UIEvents';
import AnalyticsAdapter from '../../statistics/AnalyticsAdapter';
const defaultBottomToolbarButtons = { const defaultBottomToolbarButtons = {
'chat': '#bottom_toolbar_chat', 'chat': '#bottom_toolbar_chat',
@ -38,15 +37,17 @@ const BottomToolbar = {
const buttonHandlers = { const buttonHandlers = {
"bottom_toolbar_contact_list": function () { "bottom_toolbar_contact_list": function () {
AnalyticsAdapter.sendEvent('bottomtoolbar.contacts.toggled'); JitsiMeetJS.analytics.sendEvent(
'bottomtoolbar.contacts.toggled');
emitter.emit(UIEvents.TOGGLE_CONTACT_LIST); emitter.emit(UIEvents.TOGGLE_CONTACT_LIST);
}, },
"bottom_toolbar_film_strip": function () { "bottom_toolbar_film_strip": function () {
AnalyticsAdapter.sendEvent('bottomtoolbar.filmstrip.toggled'); JitsiMeetJS.analytics.sendEvent(
'bottomtoolbar.filmstrip.toggled');
emitter.emit(UIEvents.TOGGLE_FILM_STRIP); emitter.emit(UIEvents.TOGGLE_FILM_STRIP);
}, },
"bottom_toolbar_chat": function () { "bottom_toolbar_chat": function () {
AnalyticsAdapter.sendEvent('bottomtoolbar.chat.toggled'); JitsiMeetJS.analytics.sendEvent('bottomtoolbar.chat.toggled');
emitter.emit(UIEvents.TOGGLE_CHAT); emitter.emit(UIEvents.TOGGLE_CHAT);
} }
}; };

View File

@ -1,7 +1,6 @@
/* global APP, $, config, interfaceConfig */ /* global APP, $, config, interfaceConfig, JitsiMeetJS */
/* jshint -W101 */ /* jshint -W101 */
import UIUtil from '../util/UIUtil'; import UIUtil from '../util/UIUtil';
import AnalyticsAdapter from '../../statistics/AnalyticsAdapter';
import UIEvents from '../../../service/UI/UIEvents'; import UIEvents from '../../../service/UI/UIEvents';
let roomUrl = null; let roomUrl = null;
@ -26,11 +25,11 @@ function openLinkDialog () {
false, "dialog.Invite", false, "dialog.Invite",
function (e, v) { function (e, v) {
if (v && roomUrl) { if (v && roomUrl) {
AnalyticsAdapter.sendEvent('toolbar.invite.button'); JitsiMeetJS.analytics.sendEvent('toolbar.invite.button');
emitter.emit(UIEvents.USER_INVITED, roomUrl); emitter.emit(UIEvents.USER_INVITED, roomUrl);
} }
else { else {
AnalyticsAdapter.sendEvent('toolbar.invite.cancel'); JitsiMeetJS.analytics.sendEvent('toolbar.invite.cancel');
} }
}, },
function (event) { function (event) {
@ -44,7 +43,7 @@ function openLinkDialog () {
}, },
function (e, v, m, f) { function (e, v, m, f) {
if(!v && !m && !f) if(!v && !m && !f)
AnalyticsAdapter.sendEvent('toolbar.invite.close'); JitsiMeetJS.analytics.sendEvent('toolbar.invite.close');
} }
); );
} }
@ -64,78 +63,78 @@ const buttonHandlers = {
$("#unableToUnmutePopup"), true, 5000); $("#unableToUnmutePopup"), true, 5000);
} }
else { else {
AnalyticsAdapter.sendEvent('toolbar.audio.unmuted'); JitsiMeetJS.analytics.sendEvent('toolbar.audio.unmuted');
emitter.emit(UIEvents.AUDIO_MUTED, false, true); emitter.emit(UIEvents.AUDIO_MUTED, false, true);
} }
} else { } else {
AnalyticsAdapter.sendEvent('toolbar.audio.muted'); JitsiMeetJS.analytics.sendEvent('toolbar.audio.muted');
emitter.emit(UIEvents.AUDIO_MUTED, true, true); emitter.emit(UIEvents.AUDIO_MUTED, true, true);
} }
}, },
"toolbar_button_camera": function () { "toolbar_button_camera": function () {
if (APP.conference.videoMuted) { if (APP.conference.videoMuted) {
AnalyticsAdapter.sendEvent('toolbar.video.enabled'); JitsiMeetJS.analytics.sendEvent('toolbar.video.enabled');
emitter.emit(UIEvents.VIDEO_MUTED, false); emitter.emit(UIEvents.VIDEO_MUTED, false);
} else { } else {
AnalyticsAdapter.sendEvent('toolbar.video.disabled'); JitsiMeetJS.analytics.sendEvent('toolbar.video.disabled');
emitter.emit(UIEvents.VIDEO_MUTED, true); emitter.emit(UIEvents.VIDEO_MUTED, true);
} }
}, },
"toolbar_button_security": function () { "toolbar_button_security": function () {
AnalyticsAdapter.sendEvent('toolbar.lock.clicked'); JitsiMeetJS.analytics.sendEvent('toolbar.lock.clicked');
emitter.emit(UIEvents.ROOM_LOCK_CLICKED); emitter.emit(UIEvents.ROOM_LOCK_CLICKED);
}, },
"toolbar_button_link": function () { "toolbar_button_link": function () {
AnalyticsAdapter.sendEvent('toolbar.invite.clicked'); JitsiMeetJS.analytics.sendEvent('toolbar.invite.clicked');
openLinkDialog(); openLinkDialog();
}, },
"toolbar_button_chat": function () { "toolbar_button_chat": function () {
AnalyticsAdapter.sendEvent('toolbar.chat.toggled'); JitsiMeetJS.analytics.sendEvent('toolbar.chat.toggled');
emitter.emit(UIEvents.TOGGLE_CHAT); emitter.emit(UIEvents.TOGGLE_CHAT);
}, },
"toolbar_button_etherpad": function () { "toolbar_button_etherpad": function () {
AnalyticsAdapter.sendEvent('toolbar.etherpad.clicked'); JitsiMeetJS.analytics.sendEvent('toolbar.etherpad.clicked');
emitter.emit(UIEvents.ETHERPAD_CLICKED); emitter.emit(UIEvents.ETHERPAD_CLICKED);
}, },
"toolbar_button_sharedvideo": function () { "toolbar_button_sharedvideo": function () {
AnalyticsAdapter.sendEvent('toolbar.sharedvideo.clicked'); JitsiMeetJS.analytics.sendEvent('toolbar.sharedvideo.clicked');
emitter.emit(UIEvents.SHARED_VIDEO_CLICKED); emitter.emit(UIEvents.SHARED_VIDEO_CLICKED);
}, },
"toolbar_button_desktopsharing": function () { "toolbar_button_desktopsharing": function () {
if (APP.conference.isSharingScreen) { if (APP.conference.isSharingScreen) {
AnalyticsAdapter.sendEvent('toolbar.screen.disabled'); JitsiMeetJS.analytics.sendEvent('toolbar.screen.disabled');
} else { } else {
AnalyticsAdapter.sendEvent('toolbar.screen.enabled'); JitsiMeetJS.analytics.sendEvent('toolbar.screen.enabled');
} }
emitter.emit(UIEvents.TOGGLE_SCREENSHARING); emitter.emit(UIEvents.TOGGLE_SCREENSHARING);
}, },
"toolbar_button_fullScreen": function() { "toolbar_button_fullScreen": function() {
AnalyticsAdapter.sendEvent('toolbar.fullscreen.enabled'); JitsiMeetJS.analytics.sendEvent('toolbar.fullscreen.enabled');
UIUtil.buttonClick("#toolbar_button_fullScreen", "icon-full-screen icon-exit-full-screen"); UIUtil.buttonClick("#toolbar_button_fullScreen", "icon-full-screen icon-exit-full-screen");
emitter.emit(UIEvents.FULLSCREEN_TOGGLE); emitter.emit(UIEvents.FULLSCREEN_TOGGLE);
}, },
"toolbar_button_sip": function () { "toolbar_button_sip": function () {
AnalyticsAdapter.sendEvent('toolbar.sip.clicked'); JitsiMeetJS.analytics.sendEvent('toolbar.sip.clicked');
showSipNumberInput(); showSipNumberInput();
}, },
"toolbar_button_dialpad": function () { "toolbar_button_dialpad": function () {
AnalyticsAdapter.sendEvent('toolbar.sip.dialpad.clicked'); JitsiMeetJS.analytics.sendEvent('toolbar.sip.dialpad.clicked');
dialpadButtonClicked(); dialpadButtonClicked();
}, },
"toolbar_button_settings": function () { "toolbar_button_settings": function () {
AnalyticsAdapter.sendEvent('toolbar.settings.toggled'); JitsiMeetJS.analytics.sendEvent('toolbar.settings.toggled');
emitter.emit(UIEvents.TOGGLE_SETTINGS); emitter.emit(UIEvents.TOGGLE_SETTINGS);
}, },
"toolbar_button_hangup": function () { "toolbar_button_hangup": function () {
AnalyticsAdapter.sendEvent('toolbar.hangup'); JitsiMeetJS.analytics.sendEvent('toolbar.hangup');
emitter.emit(UIEvents.HANGUP); emitter.emit(UIEvents.HANGUP);
}, },
"toolbar_button_login": function () { "toolbar_button_login": function () {
AnalyticsAdapter.sendEvent('toolbar.authenticate.login.clicked'); JitsiMeetJS.analytics.sendEvent('toolbar.authenticate.login.clicked');
emitter.emit(UIEvents.AUTH_CLICKED); emitter.emit(UIEvents.AUTH_CLICKED);
}, },
"toolbar_button_logout": function () { "toolbar_button_logout": function () {
AnalyticsAdapter.sendEvent('toolbar.authenticate.logout.clicked'); JitsiMeetJS.analytics.sendEvent('toolbar.authenticate.logout.clicked');
// Ask for confirmation // Ask for confirmation
APP.UI.messageHandler.openTwoButtonDialog( APP.UI.messageHandler.openTwoButtonDialog(
"dialog.logoutTitle", "dialog.logoutTitle",

View File

@ -3,7 +3,6 @@
import Avatar from "../avatar/Avatar"; import Avatar from "../avatar/Avatar";
import UIUtil from "../util/UIUtil"; import UIUtil from "../util/UIUtil";
import UIEvents from "../../../service/UI/UIEvents"; import UIEvents from "../../../service/UI/UIEvents";
import AnalyticsAdapter from '../../statistics/AnalyticsAdapter';
const RTCUIHelper = JitsiMeetJS.util.RTCUIHelper; const RTCUIHelper = JitsiMeetJS.util.RTCUIHelper;

View File

@ -1,5 +1,4 @@
/* global APP, $ */ /* global APP, $, JitsiMeetJS */
import AnalyticsAdapter from '../statistics/AnalyticsAdapter';
//maps keycode to character, id of popover for given function and function //maps keycode to character, id of popover for given function and function
var shortcuts = {}; var shortcuts = {};
function initShortcutHandlers() { function initShortcutHandlers() {
@ -14,7 +13,7 @@ function initShortcutHandlers() {
character: "C", character: "C",
id: "toggleChatPopover", id: "toggleChatPopover",
function: function() { function: function() {
AnalyticsAdapter.sendEvent('shortcut.chat.toggled'); JitsiMeetJS.analytics.sendEvent('shortcut.chat.toggled');
APP.UI.toggleChat(); APP.UI.toggleChat();
} }
}, },
@ -22,7 +21,7 @@ function initShortcutHandlers() {
character: "D", character: "D",
id: "toggleDesktopSharingPopover", id: "toggleDesktopSharingPopover",
function: function () { function: function () {
AnalyticsAdapter.sendEvent('shortcut.screen.toggled'); JitsiMeetJS.analytics.sendEvent('shortcut.screen.toggled');
APP.conference.toggleScreenSharing(); APP.conference.toggleScreenSharing();
} }
}, },
@ -30,7 +29,7 @@ function initShortcutHandlers() {
character: "F", character: "F",
id: "filmstripPopover", id: "filmstripPopover",
function: function() { function: function() {
AnalyticsAdapter.sendEvent('shortcut.film.toggled'); JitsiMeetJS.analytics.sendEvent('shortcut.film.toggled');
APP.UI.toggleFilmStrip(); APP.UI.toggleFilmStrip();
} }
}, },
@ -38,14 +37,14 @@ function initShortcutHandlers() {
character: "M", character: "M",
id: "mutePopover", id: "mutePopover",
function: function() { function: function() {
AnalyticsAdapter.sendEvent('shortcut.audiomute.toggled'); JitsiMeetJS.analytics.sendEvent('shortcut.audiomute.toggled');
APP.conference.toggleAudioMuted(); APP.conference.toggleAudioMuted();
} }
}, },
"R": { "R": {
character: "R", character: "R",
function: function() { function: function() {
AnalyticsAdapter.sendEvent('shortcut.raisedhand.toggled'); JitsiMeetJS.analytics.sendEvent('shortcut.raisedhand.toggled');
APP.conference.maybeToggleRaisedHand(); APP.conference.maybeToggleRaisedHand();
} }
@ -53,7 +52,7 @@ function initShortcutHandlers() {
"T": { "T": {
character: "T", character: "T",
function: function() { function: function() {
AnalyticsAdapter.sendEvent('shortcut.talk.clicked'); JitsiMeetJS.analytics.sendEvent('shortcut.talk.clicked');
APP.conference.muteAudio(true); APP.conference.muteAudio(true);
} }
}, },
@ -61,14 +60,14 @@ function initShortcutHandlers() {
character: "V", character: "V",
id: "toggleVideoPopover", id: "toggleVideoPopover",
function: function() { function: function() {
AnalyticsAdapter.sendEvent('shortcut.videomute.toggled'); JitsiMeetJS.analytics.sendEvent('shortcut.videomute.toggled');
APP.conference.toggleVideoMuted(); APP.conference.toggleVideoMuted();
} }
}, },
"?": { "?": {
character: "?", character: "?",
function: function(e) { function: function(e) {
AnalyticsAdapter.sendEvent('shortcut.shortcut.help'); JitsiMeetJS.analytics.sendEvent('shortcut.shortcut.help');
APP.UI.toggleKeyboardShortcutsPanel(); APP.UI.toggleKeyboardShortcutsPanel();
} }
} }

View File

@ -1,18 +0,0 @@
/* global config, JitsiMeetJS */
// Load the integration of a third-party analytics API such as Google Analytics.
// Since we cannot guarantee the quality of the third-party service (e.g. their
// server may take noticeably long time to respond), it is in our best interest
// (in the sense that the intergration of the analytics API is important to us
// but not enough to allow it to prevent people from joining a conference) to
// download the API asynchronously. Additionally, Google Analytics will download
// its implementation asynchronously anyway so it makes sense to append the
// loading on our side rather than prepend it.
if (config.disableThirdPartyRequests !== true) {
JitsiMeetJS.util.ScriptUtil.loadScript(
'analytics.js?v=1',
/* async */ true,
/* prepend */ false);
}
export default JitsiMeetJS.analytics;