Przeglądaj źródła

feat(analytics): Adds metric for SS issues.

j8
Hristo Terezov 4 lat temu
rodzic
commit
d4596889df

+ 32
- 6
modules/UI/videolayout/LargeVideoManager.js Wyświetl plik

6
 import { I18nextProvider } from 'react-i18next';
6
 import { I18nextProvider } from 'react-i18next';
7
 import { Provider } from 'react-redux';
7
 import { Provider } from 'react-redux';
8
 
8
 
9
+import { createScreenSharingIssueEvent, sendAnalytics } from '../../../react/features/analytics';
9
 import { Avatar } from '../../../react/features/base/avatar';
10
 import { Avatar } from '../../../react/features/base/avatar';
10
 import { i18next } from '../../../react/features/base/i18n';
11
 import { i18next } from '../../../react/features/base/i18n';
11
 import {
12
 import {
12
     JitsiParticipantConnectionStatus
13
     JitsiParticipantConnectionStatus
13
 } from '../../../react/features/base/lib-jitsi-meet';
14
 } from '../../../react/features/base/lib-jitsi-meet';
14
-import { VIDEO_TYPE } from '../../../react/features/base/media';
15
+import { MEDIA_TYPE, VIDEO_TYPE } from '../../../react/features/base/media';
15
 import { getParticipantById } from '../../../react/features/base/participants';
16
 import { getParticipantById } from '../../../react/features/base/participants';
17
+import { getTrackByMediaTypeAndParticipant } from '../../../react/features/base/tracks';
16
 import { CHAT_SIZE } from '../../../react/features/chat';
18
 import { CHAT_SIZE } from '../../../react/features/chat';
17
 import {
19
 import {
18
     updateKnownLargeVideoResolution
20
     updateKnownLargeVideoResolution
19
 } from '../../../react/features/large-video/actions';
21
 } from '../../../react/features/large-video/actions';
20
 import { PresenceLabel } from '../../../react/features/presence-status';
22
 import { PresenceLabel } from '../../../react/features/presence-status';
23
+import { shouldDisplayTileView } from '../../../react/features/video-layout';
21
 /* eslint-enable no-unused-vars */
24
 /* eslint-enable no-unused-vars */
22
 import UIEvents from '../../../service/UI/UIEvents';
25
 import UIEvents from '../../../service/UI/UIEvents';
23
 import { createDeferred } from '../../util/helpers';
26
 import { createDeferred } from '../../util/helpers';
203
             // FIXME this does not really make sense, because the videoType
206
             // FIXME this does not really make sense, because the videoType
204
             // (camera or desktop) is a completely different thing than
207
             // (camera or desktop) is a completely different thing than
205
             // the video container type (Etherpad, SharedVideo, VideoContainer).
208
             // the video container type (Etherpad, SharedVideo, VideoContainer).
206
-            const isVideoContainer
207
-                = LargeVideoManager.isVideoContainer(videoType);
209
+            const isVideoContainer = LargeVideoManager.isVideoContainer(videoType);
208
 
210
 
209
             this.newStreamData = null;
211
             this.newStreamData = null;
210
 
212
 
219
             this.updateAvatar();
221
             this.updateAvatar();
220
 
222
 
221
             const isVideoMuted = !stream || stream.isMuted();
223
             const isVideoMuted = !stream || stream.isMuted();
222
-            const participant = getParticipantById(APP.store.getState(), id);
224
+            const state = APP.store.getState();
225
+            const participant = getParticipantById(state, id);
223
             const connectionStatus = participant?.connectionStatus;
226
             const connectionStatus = participant?.connectionStatus;
224
             const isVideoRenderable = !isVideoMuted
227
             const isVideoRenderable = !isVideoMuted
225
                 && (APP.conference.isLocalId(id) || connectionStatus === JitsiParticipantConnectionStatus.ACTIVE);
228
                 && (APP.conference.isLocalId(id) || connectionStatus === JitsiParticipantConnectionStatus.ACTIVE);
226
-
229
+            const isAudioOnly = APP.conference.isAudioOnly();
227
             const showAvatar
230
             const showAvatar
228
                 = isVideoContainer
231
                 = isVideoContainer
229
-                    && ((APP.conference.isAudioOnly() && videoType !== VIDEO_TYPE.DESKTOP) || !isVideoRenderable);
232
+                    && ((isAudioOnly && videoType !== VIDEO_TYPE.DESKTOP) || !isVideoRenderable);
230
 
233
 
231
             let promise;
234
             let promise;
232
 
235
 
238
                 // If the intention of this switch is to show the avatar
241
                 // If the intention of this switch is to show the avatar
239
                 // we need to make sure that the video is hidden
242
                 // we need to make sure that the video is hidden
240
                 promise = container.hide();
243
                 promise = container.hide();
244
+
245
+                if ((!shouldDisplayTileView(state) || participant?.pinned) // In theory the tile view may not be
246
+                // enabled yet when we auto pin the participant.
247
+
248
+                        && participant && !participant.local && !participant.isFakeParticipant) {
249
+                    // remote participant only
250
+                    const track = getTrackByMediaTypeAndParticipant(
251
+                        state['features/base/tracks'], MEDIA_TYPE.VIDEO, id);
252
+                    const isScreenSharing = track?.videoType === 'desktop';
253
+
254
+                    if (isScreenSharing) {
255
+                        // send the event
256
+                        sendAnalytics(createScreenSharingIssueEvent({
257
+                            source: 'large-video',
258
+                            connectionStatus,
259
+                            isVideoMuted,
260
+                            isAudioOnly,
261
+                            isVideoContainer,
262
+                            videoType
263
+                        }));
264
+                    }
265
+                }
266
+
241
             } else {
267
             } else {
242
                 promise = container.show();
268
                 promise = container.show();
243
             }
269
             }

+ 13
- 0
modules/UI/videolayout/SmallVideo.js Wyświetl plik

8
 import { I18nextProvider } from 'react-i18next';
8
 import { I18nextProvider } from 'react-i18next';
9
 import { Provider } from 'react-redux';
9
 import { Provider } from 'react-redux';
10
 
10
 
11
+import { createScreenSharingIssueEvent, sendAnalytics } from '../../../react/features/analytics';
11
 import { AudioLevelIndicator } from '../../../react/features/audio-level-indicator';
12
 import { AudioLevelIndicator } from '../../../react/features/audio-level-indicator';
12
 import { Avatar as AvatarDisplay } from '../../../react/features/base/avatar';
13
 import { Avatar as AvatarDisplay } from '../../../react/features/base/avatar';
13
 import { i18next } from '../../../react/features/base/i18n';
14
 import { i18next } from '../../../react/features/base/i18n';
512
         if (this.displayMode !== oldDisplayMode) {
513
         if (this.displayMode !== oldDisplayMode) {
513
             logger.debug(`Displaying ${displayModeString} for ${this.id}, data: [${JSON.stringify(displayModeInput)}]`);
514
             logger.debug(`Displaying ${displayModeString} for ${this.id}, data: [${JSON.stringify(displayModeInput)}]`);
514
         }
515
         }
516
+
517
+        if (this.displayMode !== DISPLAY_VIDEO
518
+            && this.displayMode !== DISPLAY_VIDEO_WITH_NAME
519
+            && displayModeInput.tileViewActive
520
+            && displayModeInput.isScreenSharing
521
+            && !displayModeInput.isAudioOnly) {
522
+            // send the event
523
+            sendAnalytics(createScreenSharingIssueEvent({
524
+                source: 'thumbnail',
525
+                ...displayModeInput
526
+            }));
527
+        }
515
     }
528
     }
516
 
529
 
517
     /**
530
     /**

+ 13
- 0
react/features/analytics/AnalyticsEvents.js Wyświetl plik

588
     };
588
     };
589
 }
589
 }
590
 
590
 
591
+/**
592
+ * Creates an event which indicates the screen sharing video is not displayed when it needs to be displayed.
593
+ *
594
+ * @param {Object} attributes - Additional information that describes the issue.
595
+ * @returns {Object} The event in a format suitable for sending via sendAnalytics.
596
+ */
597
+export function createScreenSharingIssueEvent(attributes) {
598
+    return {
599
+        action: 'screen.sharing.issue',
600
+        attributes
601
+    };
602
+}
603
+
591
 /**
604
 /**
592
  * The local participant failed to send a "selected endpoint" message to the
605
  * The local participant failed to send a "selected endpoint" message to the
593
  * bridge.
606
  * bridge.

Ładowanie…
Anuluj
Zapisz