Просмотр исходного кода

ref(analytics): Use analytics from features/analytics

master
hristoterezov 7 лет назад
Родитель
Сommit
df1437f018

+ 9
- 11
conference.js Просмотреть файл

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

+ 11
- 8
modules/UI/recording/Recording.js Просмотреть файл

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

+ 8
- 8
modules/UI/shared_video/SharedVideo.js Просмотреть файл

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

+ 5
- 3
modules/UI/side_pannels/profile/Profile.js Просмотреть файл

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

+ 4
- 2
modules/UI/videolayout/Filmstrip.js Просмотреть файл

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

+ 5
- 4
modules/keyboardshortcut/keyboardshortcut.js Просмотреть файл

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

+ 6
- 3
react/features/analytics/functions.js Просмотреть файл

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

+ 2
- 2
react/features/base/conference/middleware.js Просмотреть файл

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

+ 2
- 0
react/features/base/lib-jitsi-meet/index.js Просмотреть файл

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

+ 2
- 2
react/features/feedback/components/FeedbackDialog.web.js Просмотреть файл

4
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
5
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
6
 
6
 
7
+import { sendEvent } from '../../analytics';
7
 import { Dialog } from '../../base/dialog';
8
 import { Dialog } from '../../base/dialog';
8
 import { translate } from '../../base/i18n';
9
 import { translate } from '../../base/i18n';
9
-import JitsiMeetJS from '../../base/lib-jitsi-meet';
10
 
10
 
11
 import { cancelFeedback, submitFeedback } from '../actions';
11
 import { cancelFeedback, submitFeedback } from '../actions';
12
 
12
 
145
      * @inheritdoc
145
      * @inheritdoc
146
      */
146
      */
147
     componentDidMount() {
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
 import React, { Component } from 'react';
2
 import React, { Component } from 'react';
3
 import { connect } from 'react-redux';
3
 import { connect } from 'react-redux';
4
 
4
 
5
+import { sendEvent } from '../../analytics';
5
 import { getInviteURL } from '../../base/connection';
6
 import { getInviteURL } from '../../base/connection';
6
 import { Dialog } from '../../base/dialog';
7
 import { Dialog } from '../../base/dialog';
7
 import { translate } from '../../base/i18n';
8
 import { translate } from '../../base/i18n';
8
-import JitsiMeetJS from '../../base/lib-jitsi-meet';
9
 import { getLocalParticipant, PARTICIPANT_ROLE } from '../../base/participants';
9
 import { getLocalParticipant, PARTICIPANT_ROLE } from '../../base/participants';
10
 
10
 
11
 import DialInNumbersForm from './DialInNumbersForm';
11
 import DialInNumbersForm from './DialInNumbersForm';
51
      * @inheritdoc
51
      * @inheritdoc
52
      */
52
      */
53
     componentWillUnmount() {
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
 import React, { Component } from 'react';
2
 import React, { Component } from 'react';
3
 import { connect } from 'react-redux';
3
 import { connect } from 'react-redux';
4
 
4
 
5
+import { sendEvent } from '../../analytics';
5
 import { translate } from '../../base/i18n';
6
 import { translate } from '../../base/i18n';
6
-import JitsiMeetJS from '../../base/lib-jitsi-meet';
7
 import { kickParticipant } from '../../base/participants';
7
 import { kickParticipant } from '../../base/participants';
8
 
8
 
9
 import RemoteVideoMenuButton from './RemoteVideoMenuButton';
9
 import RemoteVideoMenuButton from './RemoteVideoMenuButton';
83
     _onClick() {
83
     _onClick() {
84
         const { dispatch, onClick, participantID } = this.props;
84
         const { dispatch, onClick, participantID } = this.props;
85
 
85
 
86
-        JitsiMeetJS.analytics.sendEvent(
86
+        sendEvent(
87
             'remotevideomenu.kick',
87
             'remotevideomenu.kick',
88
             {
88
             {
89
                 value: 1,
89
                 value: 1,

+ 2
- 2
react/features/remote-video-menu/components/MuteButton.js Просмотреть файл

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

+ 2
- 2
react/features/remote-video-menu/components/RemoteControlButton.js Просмотреть файл

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

+ 2
- 2
react/features/toolbox/components/ProfileButton.web.js Просмотреть файл

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

+ 24
- 25
react/features/toolbox/defaultToolbarButtons.web.js Просмотреть файл

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

Загрузка…
Отмена
Сохранить