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

ref(analytics): Use analytics from features/analytics

master
hristoterezov 7 роки тому
джерело
коміт
df1437f018

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

@@ -16,7 +16,7 @@ import UIEvents from './service/UI/UIEvents';
16 16
 import UIUtil from './modules/UI/util/UIUtil';
17 17
 import * as JitsiMeetConferenceEvents from './ConferenceEvents';
18 18
 
19
-import { initAnalytics } from './react/features/analytics';
19
+import { initAnalytics, sendEvent } from './react/features/analytics';
20 20
 
21 21
 import EventEmitter from "events";
22 22
 
@@ -1315,7 +1315,7 @@ export default {
1315 1315
             promise = createLocalTracksF({ devices: ['video'] })
1316 1316
                 .then(([stream]) => this.useVideoStream(stream))
1317 1317
                 .then(() => {
1318
-                    JitsiMeetJS.analytics.sendEvent(
1318
+                    sendEvent(
1319 1319
                         'conference.sharingDesktop.stop');
1320 1320
                     logger.log('switched back to local video');
1321 1321
                     if (!this.localVideo && wasVideoMuted) {
@@ -1486,7 +1486,7 @@ export default {
1486 1486
             return this.useVideoStream(stream);
1487 1487
         }).then(() => {
1488 1488
             this.videoSwitchInProgress = false;
1489
-            JitsiMeetJS.analytics.sendEvent('conference.sharingDesktop.start');
1489
+            sendEvent('conference.sharingDesktop.start');
1490 1490
             logger.log('sharing local desktop');
1491 1491
         }).catch(error => {
1492 1492
             this.videoSwitchInProgress = false;
@@ -1753,7 +1753,7 @@ export default {
1753 1753
 
1754 1754
                     room.selectParticipant(id);
1755 1755
                 } catch (e) {
1756
-                    JitsiMeetJS.analytics.sendEvent(
1756
+                    sendEvent(
1757 1757
                         'selectParticipant.failed');
1758 1758
                     reportError(e);
1759 1759
                 }
@@ -1973,7 +1973,7 @@ export default {
1973 1973
                 // Longer delays will be caused by something else and will just
1974 1974
                 // poison the data.
1975 1975
                 if (delay < 2000) {
1976
-                    JitsiMeetJS.analytics.sendEvent('stream.switch.delay',
1976
+                    sendEvent('stream.switch.delay',
1977 1977
                         {value: delay});
1978 1978
                 }
1979 1979
             });
@@ -2005,7 +2005,7 @@ export default {
2005 2005
         APP.UI.addListener(
2006 2006
             UIEvents.VIDEO_DEVICE_CHANGED,
2007 2007
             (cameraDeviceId) => {
2008
-                JitsiMeetJS.analytics.sendEvent('settings.changeDevice.video');
2008
+                sendEvent('settings.changeDevice.video');
2009 2009
                 createLocalTracksF({
2010 2010
                     devices: ['video'],
2011 2011
                     cameraDeviceId: cameraDeviceId,
@@ -2033,7 +2033,7 @@ export default {
2033 2033
         APP.UI.addListener(
2034 2034
             UIEvents.AUDIO_DEVICE_CHANGED,
2035 2035
             (micDeviceId) => {
2036
-                JitsiMeetJS.analytics.sendEvent(
2036
+                sendEvent(
2037 2037
                     'settings.changeDevice.audioIn');
2038 2038
                 createLocalTracksF({
2039 2039
                     devices: ['audio'],
@@ -2054,7 +2054,7 @@ export default {
2054 2054
         APP.UI.addListener(
2055 2055
             UIEvents.AUDIO_OUTPUT_DEVICE_CHANGED,
2056 2056
             (audioOutputDeviceId) => {
2057
-                JitsiMeetJS.analytics.sendEvent(
2057
+                sendEvent(
2058 2058
                     'settings.changeDevice.audioOut');
2059 2059
                 APP.settings.setAudioOutputDeviceId(audioOutputDeviceId)
2060 2060
                     .then(() => logger.log('changed audio output device'))
@@ -2361,9 +2361,7 @@ export default {
2361 2361
      * NOTE: Should be used after conference.init
2362 2362
      */
2363 2363
     logEvent(name, value, label) {
2364
-        if (JitsiMeetJS.analytics) {
2365
-            JitsiMeetJS.analytics.sendEvent(name, {value, label});
2366
-        }
2364
+        sendEvent(name, {value, label});
2367 2365
         if (room) {
2368 2366
             room.sendApplicationLog(JSON.stringify({name, value, label}));
2369 2367
         }

+ 11
- 8
modules/UI/recording/Recording.js Переглянути файл

@@ -1,4 +1,4 @@
1
-/* global APP, $, config, interfaceConfig, JitsiMeetJS */
1
+/* global APP, $, config, interfaceConfig */
2 2
 /*
3 3
  * Copyright @ 2015 Atlassian Pty Ltd
4 4
  *
@@ -23,6 +23,9 @@ import VideoLayout from '../videolayout/VideoLayout';
23 23
 import {
24 24
     JitsiRecordingStatus
25 25
 } from '../../../react/features/base/lib-jitsi-meet';
26
+import {
27
+    sendEvent
28
+} from '../../../react/features/analytics';
26 29
 import { setToolboxEnabled } from '../../../react/features/toolbox';
27 30
 import { setNotificationsEnabled } from '../../../react/features/notifications';
28 31
 import {
@@ -437,7 +440,7 @@ var Recording = {
437 440
             return;
438 441
         }
439 442
 
440
-        JitsiMeetJS.analytics.sendEvent('recording.clicked');
443
+        sendEvent('recording.clicked');
441 444
         switch (this.currentState) {
442 445
         case JitsiRecordingStatus.ON:
443 446
         case JitsiRecordingStatus.RETRYING:
@@ -445,7 +448,7 @@ var Recording = {
445 448
             _showStopRecordingPrompt(this.recordingType).then(
446 449
                 () => {
447 450
                     this.eventEmitter.emit(UIEvents.RECORDING_TOGGLED);
448
-                    JitsiMeetJS.analytics.sendEvent('recording.stopped');
451
+                    sendEvent('recording.stopped');
449 452
                 },
450 453
                 () => {});
451 454
             break;
@@ -457,19 +460,19 @@ var Recording = {
457 460
                     this.eventEmitter.emit(
458 461
                         UIEvents.RECORDING_TOGGLED,
459 462
                         { streamId });
460
-                    JitsiMeetJS.analytics.sendEvent('recording.started');
463
+                    sendEvent('recording.started');
461 464
                 }).catch(reason => {
462 465
                     if (reason !== APP.UI.messageHandler.CANCEL)
463 466
                         logger.error(reason);
464 467
                     else
465
-                        JitsiMeetJS.analytics.sendEvent('recording.canceled');
468
+                        sendEvent('recording.canceled');
466 469
                 });
467 470
             else {
468 471
                 if (this.predefinedToken) {
469 472
                     this.eventEmitter.emit(
470 473
                         UIEvents.RECORDING_TOGGLED,
471 474
                         { token: this.predefinedToken });
472
-                    JitsiMeetJS.analytics.sendEvent('recording.started');
475
+                    sendEvent('recording.started');
473 476
                     return;
474 477
                 }
475 478
 
@@ -477,12 +480,12 @@ var Recording = {
477 480
                     this.eventEmitter.emit(
478 481
                         UIEvents.RECORDING_TOGGLED,
479 482
                         { token });
480
-                    JitsiMeetJS.analytics.sendEvent('recording.started');
483
+                    sendEvent('recording.started');
481 484
                 }).catch(reason => {
482 485
                     if (reason !== APP.UI.messageHandler.CANCEL)
483 486
                         logger.error(reason);
484 487
                     else
485
-                        JitsiMeetJS.analytics.sendEvent('recording.canceled');
488
+                        sendEvent('recording.canceled');
486 489
                 });
487 490
             }
488 491
             break;

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

@@ -1,5 +1,4 @@
1
-/* global $, APP, YT, onPlayerReady, onPlayerStateChange, onPlayerError,
2
-JitsiMeetJS */
1
+/* global $, APP, YT, onPlayerReady, onPlayerStateChange, onPlayerError */
3 2
 const logger = require("jitsi-meet-logger").getLogger(__filename);
4 3
 
5 4
 import UIUtil from '../util/UIUtil';
@@ -9,6 +8,7 @@ import VideoLayout from "../videolayout/VideoLayout";
9 8
 import LargeContainer from '../videolayout/LargeContainer';
10 9
 import Filmstrip from '../videolayout/Filmstrip';
11 10
 
11
+import { sendEvent } from '../../../react/features/analytics';
12 12
 import {
13 13
     participantJoined,
14 14
     participantLeft
@@ -79,11 +79,11 @@ export default class SharedVideoManager {
79 79
                     url => {
80 80
                         this.emitter.emit(
81 81
                             UIEvents.UPDATE_SHARED_VIDEO, url, 'start');
82
-                        JitsiMeetJS.analytics.sendEvent('sharedvideo.started');
82
+                        sendEvent('sharedvideo.started');
83 83
                     },
84 84
                     err => {
85 85
                         logger.log('SHARED VIDEO CANCELED', err);
86
-                        JitsiMeetJS.analytics.sendEvent('sharedvideo.canceled');
86
+                        sendEvent('sharedvideo.canceled');
87 87
                     }
88 88
             );
89 89
             return;
@@ -102,7 +102,7 @@ export default class SharedVideoManager {
102 102
                     }
103 103
                     this.emitter.emit(
104 104
                         UIEvents.UPDATE_SHARED_VIDEO, this.url, 'stop');
105
-                    JitsiMeetJS.analytics.sendEvent('sharedvideo.stoped');
105
+                    sendEvent('sharedvideo.stoped');
106 106
                 },
107 107
                 () => {});
108 108
         } else {
@@ -114,7 +114,7 @@ export default class SharedVideoManager {
114 114
                     dialog = null;
115 115
                 }
116 116
             );
117
-            JitsiMeetJS.analytics.sendEvent('sharedvideo.alreadyshared');
117
+            sendEvent('sharedvideo.alreadyshared');
118 118
         }
119 119
     }
120 120
 
@@ -218,7 +218,7 @@ export default class SharedVideoManager {
218 218
                 self.smartAudioMute();
219 219
             } else if (event.data == YT.PlayerState.PAUSED) {
220 220
                 self.smartAudioUnmute();
221
-                JitsiMeetJS.analytics.sendEvent('sharedvideo.paused');
221
+                sendEvent('sharedvideo.paused');
222 222
             }
223 223
             self.fireSharedVideoEvent(event.data == YT.PlayerState.PAUSED);
224 224
         };
@@ -248,7 +248,7 @@ export default class SharedVideoManager {
248 248
             else if (event.data.volume <=0 || event.data.muted) {
249 249
                 self.smartAudioUnmute();
250 250
             }
251
-            JitsiMeetJS.analytics.sendEvent('sharedvideo.volumechanged');
251
+            sendEvent('sharedvideo.volumechanged');
252 252
         };
253 253
 
254 254
         window.onPlayerReady = function(event) {

+ 5
- 3
modules/UI/side_pannels/profile/Profile.js Переглянути файл

@@ -1,8 +1,10 @@
1
-/* global $, APP, JitsiMeetJS */
1
+/* global $, APP */
2 2
 import UIUtil from "../../util/UIUtil";
3 3
 import UIEvents from "../../../../service/UI/UIEvents";
4 4
 import Settings from '../../../settings/Settings';
5 5
 
6
+import { sendEvent } from '../../../../react/features/analytics';
7
+
6 8
 const sidePanelsContainerId = 'sideToolbarContainer';
7 9
 const htmlStr = `
8 10
     <div id="profile_container" class="sideToolbarContainer__inner">
@@ -74,7 +76,7 @@ export default {
74 76
 
75 77
         // LOGIN
76 78
         function loginClicked () {
77
-            JitsiMeetJS.analytics.sendEvent('authenticate.login.clicked');
79
+            sendEvent('authenticate.login.clicked');
78 80
             emitter.emit(UIEvents.AUTH_CLICKED);
79 81
         }
80 82
 
@@ -84,7 +86,7 @@ export default {
84 86
         function logoutClicked () {
85 87
             let titleKey = "dialog.logoutTitle";
86 88
             let msgKey = "dialog.logoutQuestion";
87
-            JitsiMeetJS.analytics.sendEvent('authenticate.logout.clicked');
89
+            sendEvent('authenticate.logout.clicked');
88 90
             // Ask for confirmation
89 91
             APP.UI.messageHandler.openTwoButtonDialog({
90 92
                 titleKey: titleKey,

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

@@ -1,10 +1,12 @@
1
-/* global $, APP, JitsiMeetJS, interfaceConfig */
1
+/* global $, APP, interfaceConfig */
2 2
 
3 3
 import { setFilmstripVisibility } from '../../../react/features/filmstrip';
4 4
 
5 5
 import UIEvents from "../../../service/UI/UIEvents";
6 6
 import UIUtil from "../util/UIUtil";
7 7
 
8
+import { sendEvent } from '../../../react/features/analytics';
9
+
8 10
 const Filmstrip = {
9 11
     /**
10 12
      *
@@ -141,7 +143,7 @@ const Filmstrip = {
141 143
             return;
142 144
         }
143 145
         if (sendAnalytics) {
144
-            JitsiMeetJS.analytics.sendEvent('toolbar.filmstrip.toggled');
146
+            sendEvent('toolbar.filmstrip.toggled');
145 147
         }
146 148
         this.filmstrip.toggleClass("hidden");
147 149
 

+ 5
- 4
modules/keyboardshortcut/keyboardshortcut.js Переглянути файл

@@ -1,6 +1,7 @@
1
-/* global APP, $, JitsiMeetJS, interfaceConfig */
1
+/* global APP, $, interfaceConfig */
2 2
 
3 3
 import { toggleDialog } from '../../react/features/base/dialog';
4
+import { sendEvent } from '../../react/features/analytics';
4 5
 import { SpeakerStats } from '../../react/features/speaker-stats';
5 6
 
6 7
 /**
@@ -20,20 +21,20 @@ function initGlobalShortcuts() {
20 21
     });
21 22
 
22 23
     KeyboardShortcut.registerShortcut("?", null, function() {
23
-        JitsiMeetJS.analytics.sendEvent("shortcut.shortcut.help");
24
+        sendEvent("shortcut.shortcut.help");
24 25
         showKeyboardShortcutsPanel(true);
25 26
     }, "keyboardShortcuts.toggleShortcuts");
26 27
 
27 28
     // register SPACE shortcut in two steps to insure visibility of help message
28 29
     KeyboardShortcut.registerShortcut(" ", null, function() {
29
-        JitsiMeetJS.analytics.sendEvent("shortcut.talk.clicked");
30
+        sendEvent("shortcut.talk.clicked");
30 31
         APP.conference.muteAudio(true);
31 32
     });
32 33
     KeyboardShortcut._addShortcutToHelp("SPACE","keyboardShortcuts.pushToTalk");
33 34
 
34 35
     if(!interfaceConfig.filmStripOnly) {
35 36
         KeyboardShortcut.registerShortcut("T", null, () => {
36
-            JitsiMeetJS.analytics.sendEvent("shortcut.speakerStats.clicked");
37
+            sendEvent("shortcut.speakerStats.clicked");
37 38
             APP.store.dispatch(toggleDialog(SpeakerStats, {
38 39
                 conference: APP.conference
39 40
             }));

+ 6
- 3
react/features/analytics/functions.js Переглянути файл

@@ -1,10 +1,15 @@
1 1
 // @flow
2 2
 
3
-import JitsiMeetJS, { isAnalyticsEnabled } from '../base/lib-jitsi-meet';
3
+import JitsiMeetJS, {
4
+    analytics,
5
+    isAnalyticsEnabled
6
+} from '../base/lib-jitsi-meet';
4 7
 import { getJitsiMeetGlobalNS, loadScript } from '../base/util';
5 8
 
6 9
 const logger = require('jitsi-meet-logger').getLogger(__filename);
7 10
 
11
+export const sendEvent = analytics.sendEvent.bind(analytics);
12
+
8 13
 /**
9 14
  * Loads the analytics scripts and inits JitsiMeetJS.analytics by setting
10 15
  * permanent properties and setting the handlers from the loaded scripts.
@@ -19,8 +24,6 @@ export function initAnalytics({ getState }: { getState: Function }) {
19 24
     getJitsiMeetGlobalNS().analyticsHandlers = [];
20 25
     window.analyticsHandlers = []; // Legacy support.
21 26
 
22
-    const { analytics } = JitsiMeetJS;
23
-
24 27
     if (!analytics || !isAnalyticsEnabled(getState)) {
25 28
         return;
26 29
     }

+ 2
- 2
react/features/base/conference/middleware.js Переглянути файл

@@ -2,8 +2,8 @@
2 2
 
3 3
 import UIEvents from '../../../../service/UI/UIEvents';
4 4
 
5
+import { sendEvent } from '../../analytics';
5 6
 import { CONNECTION_ESTABLISHED } from '../connection';
6
-import JitsiMeetJS from '../lib-jitsi-meet';
7 7
 import { setVideoMuted, VIDEO_MUTISM_AUTHORITY } from '../media';
8 8
 import {
9 9
     getLocalParticipant,
@@ -191,7 +191,7 @@ function _pinParticipant(store, next, action) {
191 191
             videoType = 'remote';
192 192
         }
193 193
 
194
-        JitsiMeetJS.analytics.sendEvent(
194
+        sendEvent(
195 195
                 `${actionName}.${videoType}`,
196 196
                 { value: conference.getParticipantCount() });
197 197
     }

+ 2
- 0
react/features/base/lib-jitsi-meet/index.js Переглянути файл

@@ -19,6 +19,8 @@ export const JitsiRecordingStatus = JitsiMeetJS.constants.recordingStatus;
19 19
 export const JitsiTrackErrors = JitsiMeetJS.errors.track;
20 20
 export const JitsiTrackEvents = JitsiMeetJS.events.track;
21 21
 
22
+export const analytics = JitsiMeetJS.analytics;
23
+
22 24
 export * from './actions';
23 25
 export * from './actionTypes';
24 26
 export * from './constants';

+ 2
- 2
react/features/feedback/components/FeedbackDialog.web.js Переглянути файл

@@ -4,9 +4,9 @@ import PropTypes from 'prop-types';
4 4
 import React, { Component } from 'react';
5 5
 import { connect } from 'react-redux';
6 6
 
7
+import { sendEvent } from '../../analytics';
7 8
 import { Dialog } from '../../base/dialog';
8 9
 import { translate } from '../../base/i18n';
9
-import JitsiMeetJS from '../../base/lib-jitsi-meet';
10 10
 
11 11
 import { cancelFeedback, submitFeedback } from '../actions';
12 12
 
@@ -145,7 +145,7 @@ class FeedbackDialog extends Component {
145 145
      * @inheritdoc
146 146
      */
147 147
     componentDidMount() {
148
-        JitsiMeetJS.analytics.sendEvent('feedback.open');
148
+        sendEvent('feedback.open');
149 149
     }
150 150
 
151 151
     /**

+ 2
- 2
react/features/invite/components/InviteDialog.web.js Переглянути файл

@@ -2,10 +2,10 @@ import PropTypes from 'prop-types';
2 2
 import React, { Component } from 'react';
3 3
 import { connect } from 'react-redux';
4 4
 
5
+import { sendEvent } from '../../analytics';
5 6
 import { getInviteURL } from '../../base/connection';
6 7
 import { Dialog } from '../../base/dialog';
7 8
 import { translate } from '../../base/i18n';
8
-import JitsiMeetJS from '../../base/lib-jitsi-meet';
9 9
 import { getLocalParticipant, PARTICIPANT_ROLE } from '../../base/participants';
10 10
 
11 11
 import DialInNumbersForm from './DialInNumbersForm';
@@ -51,7 +51,7 @@ class InviteDialog extends Component {
51 51
      * @inheritdoc
52 52
      */
53 53
     componentWillUnmount() {
54
-        JitsiMeetJS.analytics.sendEvent('toolbar.invite.close');
54
+        sendEvent('toolbar.invite.close');
55 55
     }
56 56
 
57 57
     /**

+ 2
- 2
react/features/remote-video-menu/components/KickButton.js Переглянути файл

@@ -2,8 +2,8 @@ import PropTypes from 'prop-types';
2 2
 import React, { Component } from 'react';
3 3
 import { connect } from 'react-redux';
4 4
 
5
+import { sendEvent } from '../../analytics';
5 6
 import { translate } from '../../base/i18n';
6
-import JitsiMeetJS from '../../base/lib-jitsi-meet';
7 7
 import { kickParticipant } from '../../base/participants';
8 8
 
9 9
 import RemoteVideoMenuButton from './RemoteVideoMenuButton';
@@ -83,7 +83,7 @@ class KickButton extends Component {
83 83
     _onClick() {
84 84
         const { dispatch, onClick, participantID } = this.props;
85 85
 
86
-        JitsiMeetJS.analytics.sendEvent(
86
+        sendEvent(
87 87
             'remotevideomenu.kick',
88 88
             {
89 89
                 value: 1,

+ 2
- 2
react/features/remote-video-menu/components/MuteButton.js Переглянути файл

@@ -2,8 +2,8 @@ import PropTypes from 'prop-types';
2 2
 import React, { Component } from 'react';
3 3
 import { connect } from 'react-redux';
4 4
 
5
+import { sendEvent } from '../../analytics';
5 6
 import { translate } from '../../base/i18n';
6
-import JitsiMeetJS from '../../base/lib-jitsi-meet';
7 7
 import { muteRemoteParticipant } from '../../base/participants';
8 8
 
9 9
 import RemoteVideoMenuButton from './RemoteVideoMenuButton';
@@ -97,7 +97,7 @@ class MuteButton extends Component {
97 97
     _onClick() {
98 98
         const { dispatch, onClick, participantID } = this.props;
99 99
 
100
-        JitsiMeetJS.analytics.sendEvent(
100
+        sendEvent(
101 101
             'remotevideomenu.mute',
102 102
             {
103 103
                 value: 1,

+ 2
- 2
react/features/remote-video-menu/components/RemoteControlButton.js Переглянути файл

@@ -1,7 +1,7 @@
1 1
 import PropTypes from 'prop-types';
2 2
 import React, { Component } from 'react';
3 3
 
4
-import JitsiMeetJS from '../../base/lib-jitsi-meet';
4
+import { sendEvent } from '../../analytics';
5 5
 import { translate } from '../../base/i18n';
6 6
 
7 7
 import RemoteVideoMenuButton from './RemoteVideoMenuButton';
@@ -130,7 +130,7 @@ class RemoteControlButton extends Component {
130 130
         }
131 131
 
132 132
         if (eventName) {
133
-            JitsiMeetJS.analytics.sendEvent(
133
+            sendEvent(
134 134
                 `remotevideomenu.remotecontrol.${eventName}`,
135 135
                 {
136 136
                     value: 1,

+ 2
- 2
react/features/toolbox/components/ProfileButton.web.js Переглянути файл

@@ -4,13 +4,13 @@ import PropTypes from 'prop-types';
4 4
 import React, { Component } from 'react';
5 5
 import { connect } from 'react-redux';
6 6
 
7
+import { sendEvent } from '../../analytics';
7 8
 import { DEFAULT_AVATAR_RELATIVE_PATH } from '../../base/participants';
8 9
 import UIEvents from '../../../../service/UI/UIEvents';
9 10
 
10 11
 import ToolbarButton from './ToolbarButton';
11 12
 
12 13
 declare var APP: Object;
13
-declare var JitsiMeetJS: Object;
14 14
 
15 15
 /**
16 16
  * The default configuration for the button.
@@ -102,7 +102,7 @@ class ProfileButton extends Component {
102 102
      */
103 103
     _onClick() {
104 104
         if (!this.props._unclickable) {
105
-            JitsiMeetJS.analytics.sendEvent('toolbar.profile.toggled');
105
+            sendEvent('toolbar.profile.toggled');
106 106
             APP.UI.emitEvent(UIEvents.TOGGLE_PROFILE);
107 107
         }
108 108
     }

+ 24
- 25
react/features/toolbox/defaultToolbarButtons.web.js Переглянути файл

@@ -2,6 +2,7 @@
2 2
 
3 3
 import React from 'react';
4 4
 
5
+import { sendEvent } from '../analytics';
5 6
 import { ParticipantCounter } from '../contact-list';
6 7
 import { openDeviceSelectionDialog } from '../device-selection';
7 8
 import { InfoDialogButton, openInviteDialog } from '../invite';
@@ -12,7 +13,6 @@ import ProfileButton from './components/ProfileButton';
12 13
 
13 14
 declare var APP: Object;
14 15
 declare var interfaceConfig: Object;
15
-declare var JitsiMeetJS: Object;
16 16
 
17 17
 /**
18 18
  * The cache of {@link getDefaultButtons()}.
@@ -42,9 +42,9 @@ export default function getDefaultButtons() {
42 42
                 const newVideoMutedState = !APP.conference.isLocalVideoMuted();
43 43
 
44 44
                 if (newVideoMutedState) {
45
-                    JitsiMeetJS.analytics.sendEvent('toolbar.video.enabled');
45
+                    sendEvent('toolbar.video.enabled');
46 46
                 } else {
47
-                    JitsiMeetJS.analytics.sendEvent('toolbar.video.disabled');
47
+                    sendEvent('toolbar.video.disabled');
48 48
                 }
49 49
                 APP.UI.emitEvent(UIEvents.VIDEO_MUTED, newVideoMutedState);
50 50
             },
@@ -64,7 +64,7 @@ export default function getDefaultButtons() {
64 64
                     return;
65 65
                 }
66 66
 
67
-                JitsiMeetJS.analytics.sendEvent('shortcut.videomute.toggled');
67
+                sendEvent('shortcut.videomute.toggled');
68 68
                 APP.conference.toggleVideoMuted();
69 69
             },
70 70
             shortcutDescription: 'keyboardShortcuts.videoMute',
@@ -81,13 +81,13 @@ export default function getDefaultButtons() {
81 81
                 <span id = 'unreadMessages' /></span>,
82 82
             id: 'toolbar_button_chat',
83 83
             onClick() {
84
-                JitsiMeetJS.analytics.sendEvent('toolbar.chat.toggled');
84
+                sendEvent('toolbar.chat.toggled');
85 85
                 APP.UI.emitEvent(UIEvents.TOGGLE_CHAT);
86 86
             },
87 87
             shortcut: 'C',
88 88
             shortcutAttr: 'toggleChatPopover',
89 89
             shortcutFunc() {
90
-                JitsiMeetJS.analytics.sendEvent('shortcut.chat.toggled');
90
+                sendEvent('shortcut.chat.toggled');
91 91
                 APP.UI.toggleChat();
92 92
             },
93 93
             shortcutDescription: 'keyboardShortcuts.toggleChat',
@@ -104,7 +104,7 @@ export default function getDefaultButtons() {
104 104
             enabled: true,
105 105
             id: 'toolbar_contact_list',
106 106
             onClick() {
107
-                JitsiMeetJS.analytics.sendEvent(
107
+                sendEvent(
108 108
                     'toolbar.contacts.toggled');
109 109
                 APP.UI.emitEvent(UIEvents.TOGGLE_CONTACT_LIST);
110 110
             },
@@ -121,9 +121,9 @@ export default function getDefaultButtons() {
121 121
             id: 'toolbar_button_desktopsharing',
122 122
             onClick() {
123 123
                 if (APP.conference.isSharingScreen) {
124
-                    JitsiMeetJS.analytics.sendEvent('toolbar.screen.disabled');
124
+                    sendEvent('toolbar.screen.disabled');
125 125
                 } else {
126
-                    JitsiMeetJS.analytics.sendEvent('toolbar.screen.enabled');
126
+                    sendEvent('toolbar.screen.enabled');
127 127
                 }
128 128
                 APP.UI.emitEvent(UIEvents.TOGGLE_SCREENSHARING);
129 129
             },
@@ -137,7 +137,7 @@ export default function getDefaultButtons() {
137 137
             shortcut: 'D',
138 138
             shortcutAttr: 'toggleDesktopSharingPopover',
139 139
             shortcutFunc() {
140
-                JitsiMeetJS.analytics.sendEvent('shortcut.screen.toggled');
140
+                sendEvent('shortcut.screen.toggled');
141 141
 
142 142
                 // eslint-disable-next-line no-empty-function
143 143
                 APP.conference.toggleScreenSharing().catch(() => {});
@@ -157,7 +157,7 @@ export default function getDefaultButtons() {
157 157
             },
158 158
             id: 'toolbar_button_fodeviceselection',
159 159
             onClick(dispatch: Function) {
160
-                JitsiMeetJS.analytics.sendEvent(
160
+                sendEvent(
161 161
                     'toolbar.fodeviceselection.toggled');
162 162
 
163 163
                 dispatch(openDeviceSelectionDialog());
@@ -177,7 +177,7 @@ export default function getDefaultButtons() {
177 177
             hidden: true,
178 178
             id: 'toolbar_button_dialpad',
179 179
             onClick() {
180
-                JitsiMeetJS.analytics.sendEvent('toolbar.sip.dialpad.clicked');
180
+                sendEvent('toolbar.sip.dialpad.clicked');
181 181
             },
182 182
             tooltipKey: 'toolbar.dialpad'
183 183
         },
@@ -191,7 +191,7 @@ export default function getDefaultButtons() {
191 191
             hidden: true,
192 192
             id: 'toolbar_button_etherpad',
193 193
             onClick() {
194
-                JitsiMeetJS.analytics.sendEvent('toolbar.etherpad.clicked');
194
+                sendEvent('toolbar.etherpad.clicked');
195 195
                 APP.UI.emitEvent(UIEvents.ETHERPAD_CLICKED);
196 196
             },
197 197
             tooltipKey: 'toolbar.etherpad'
@@ -205,7 +205,7 @@ export default function getDefaultButtons() {
205 205
             enabled: true,
206 206
             id: 'toolbar_button_fullScreen',
207 207
             onClick() {
208
-                JitsiMeetJS.analytics.sendEvent('toolbar.fullscreen.enabled');
208
+                sendEvent('toolbar.fullscreen.enabled');
209 209
 
210 210
                 APP.UI.emitEvent(UIEvents.TOGGLE_FULLSCREEN);
211 211
             },
@@ -213,7 +213,7 @@ export default function getDefaultButtons() {
213 213
             shortcutAttr: 'toggleFullscreenPopover',
214 214
             shortcutDescription: 'keyboardShortcuts.fullScreen',
215 215
             shortcutFunc() {
216
-                JitsiMeetJS.analytics.sendEvent('shortcut.fullscreen.toggled');
216
+                sendEvent('shortcut.fullscreen.toggled');
217 217
                 APP.UI.toggleFullScreen();
218 218
             },
219 219
             tooltipKey: 'toolbar.fullscreen'
@@ -229,7 +229,7 @@ export default function getDefaultButtons() {
229 229
             isDisplayed: () => true,
230 230
             id: 'toolbar_button_hangup',
231 231
             onClick() {
232
-                JitsiMeetJS.analytics.sendEvent('toolbar.hangup');
232
+                sendEvent('toolbar.hangup');
233 233
                 APP.UI.emitEvent(UIEvents.HANGUP);
234 234
             },
235 235
             tooltipKey: 'toolbar.hangup'
@@ -252,7 +252,7 @@ export default function getDefaultButtons() {
252 252
             enabled: true,
253 253
             id: 'toolbar_button_link',
254 254
             onClick(dispatch: Function) {
255
-                JitsiMeetJS.analytics.sendEvent('toolbar.invite.clicked');
255
+                sendEvent('toolbar.invite.clicked');
256 256
 
257 257
                 dispatch(openInviteDialog());
258 258
             },
@@ -280,12 +280,11 @@ export default function getDefaultButtons() {
280 280
                         APP.UI.showCustomToolbarPopup(
281 281
                             'microphone', 'unableToUnmutePopup', true, 5000);
282 282
                     } else {
283
-                        JitsiMeetJS.analytics
284
-                            .sendEvent('toolbar.audio.unmuted');
283
+                        sendEvent('toolbar.audio.unmuted');
285 284
                         APP.UI.emitEvent(UIEvents.AUDIO_MUTED, false, true);
286 285
                     }
287 286
                 } else {
288
-                    JitsiMeetJS.analytics.sendEvent('toolbar.audio.muted');
287
+                    sendEvent('toolbar.audio.muted');
289 288
                     APP.UI.emitEvent(UIEvents.AUDIO_MUTED, true, true);
290 289
                 }
291 290
             },
@@ -306,7 +305,7 @@ export default function getDefaultButtons() {
306 305
             shortcut: 'M',
307 306
             shortcutAttr: 'mutePopover',
308 307
             shortcutFunc() {
309
-                JitsiMeetJS.analytics.sendEvent('shortcut.audiomute.toggled');
308
+                sendEvent('shortcut.audiomute.toggled');
310 309
                 APP.conference.toggleAudioMuted();
311 310
             },
312 311
             shortcutDescription: 'keyboardShortcuts.mute',
@@ -329,14 +328,14 @@ export default function getDefaultButtons() {
329 328
             enabled: true,
330 329
             id: 'toolbar_button_raisehand',
331 330
             onClick() {
332
-                JitsiMeetJS.analytics.sendEvent('toolbar.raiseHand.clicked');
331
+                sendEvent('toolbar.raiseHand.clicked');
333 332
                 APP.conference.maybeToggleRaisedHand();
334 333
             },
335 334
             shortcut: 'R',
336 335
             shortcutAttr: 'raiseHandPopover',
337 336
             shortcutDescription: 'keyboardShortcuts.raiseHand',
338 337
             shortcutFunc() {
339
-                JitsiMeetJS.analytics.sendEvent('shortcut.raisehand.clicked');
338
+                sendEvent('shortcut.raisehand.clicked');
340 339
                 APP.conference.maybeToggleRaisedHand();
341 340
             },
342 341
             tooltipKey: 'toolbar.raiseHand'
@@ -364,7 +363,7 @@ export default function getDefaultButtons() {
364 363
             enabled: true,
365 364
             id: 'toolbar_button_settings',
366 365
             onClick() {
367
-                JitsiMeetJS.analytics.sendEvent('toolbar.settings.toggled');
366
+                sendEvent('toolbar.settings.toggled');
368 367
                 APP.UI.emitEvent(UIEvents.TOGGLE_SETTINGS);
369 368
             },
370 369
             sideContainerId: 'settings_container',
@@ -379,7 +378,7 @@ export default function getDefaultButtons() {
379 378
             enabled: true,
380 379
             id: 'toolbar_button_sharedvideo',
381 380
             onClick() {
382
-                JitsiMeetJS.analytics.sendEvent('toolbar.sharedvideo.clicked');
381
+                sendEvent('toolbar.sharedvideo.clicked');
383 382
                 APP.UI.emitEvent(UIEvents.SHARED_VIDEO_CLICKED);
384 383
             },
385 384
             popups: [

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