Pārlūkot izejas kodu

feat(analytics): Adds metric for SS issues.

j8
Hristo Terezov 4 gadus atpakaļ
vecāks
revīzija
d4596889df

+ 32
- 6
modules/UI/videolayout/LargeVideoManager.js Parādīt failu

@@ -6,18 +6,21 @@ import ReactDOM from 'react-dom';
6 6
 import { I18nextProvider } from 'react-i18next';
7 7
 import { Provider } from 'react-redux';
8 8
 
9
+import { createScreenSharingIssueEvent, sendAnalytics } from '../../../react/features/analytics';
9 10
 import { Avatar } from '../../../react/features/base/avatar';
10 11
 import { i18next } from '../../../react/features/base/i18n';
11 12
 import {
12 13
     JitsiParticipantConnectionStatus
13 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 16
 import { getParticipantById } from '../../../react/features/base/participants';
17
+import { getTrackByMediaTypeAndParticipant } from '../../../react/features/base/tracks';
16 18
 import { CHAT_SIZE } from '../../../react/features/chat';
17 19
 import {
18 20
     updateKnownLargeVideoResolution
19 21
 } from '../../../react/features/large-video/actions';
20 22
 import { PresenceLabel } from '../../../react/features/presence-status';
23
+import { shouldDisplayTileView } from '../../../react/features/video-layout';
21 24
 /* eslint-enable no-unused-vars */
22 25
 import UIEvents from '../../../service/UI/UIEvents';
23 26
 import { createDeferred } from '../../util/helpers';
@@ -203,8 +206,7 @@ export default class LargeVideoManager {
203 206
             // FIXME this does not really make sense, because the videoType
204 207
             // (camera or desktop) is a completely different thing than
205 208
             // the video container type (Etherpad, SharedVideo, VideoContainer).
206
-            const isVideoContainer
207
-                = LargeVideoManager.isVideoContainer(videoType);
209
+            const isVideoContainer = LargeVideoManager.isVideoContainer(videoType);
208 210
 
209 211
             this.newStreamData = null;
210 212
 
@@ -219,14 +221,15 @@ export default class LargeVideoManager {
219 221
             this.updateAvatar();
220 222
 
221 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 226
             const connectionStatus = participant?.connectionStatus;
224 227
             const isVideoRenderable = !isVideoMuted
225 228
                 && (APP.conference.isLocalId(id) || connectionStatus === JitsiParticipantConnectionStatus.ACTIVE);
226
-
229
+            const isAudioOnly = APP.conference.isAudioOnly();
227 230
             const showAvatar
228 231
                 = isVideoContainer
229
-                    && ((APP.conference.isAudioOnly() && videoType !== VIDEO_TYPE.DESKTOP) || !isVideoRenderable);
232
+                    && ((isAudioOnly && videoType !== VIDEO_TYPE.DESKTOP) || !isVideoRenderable);
230 233
 
231 234
             let promise;
232 235
 
@@ -238,6 +241,29 @@ export default class LargeVideoManager {
238 241
                 // If the intention of this switch is to show the avatar
239 242
                 // we need to make sure that the video is hidden
240 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 267
             } else {
242 268
                 promise = container.show();
243 269
             }

+ 13
- 0
modules/UI/videolayout/SmallVideo.js Parādīt failu

@@ -8,6 +8,7 @@ import ReactDOM from 'react-dom';
8 8
 import { I18nextProvider } from 'react-i18next';
9 9
 import { Provider } from 'react-redux';
10 10
 
11
+import { createScreenSharingIssueEvent, sendAnalytics } from '../../../react/features/analytics';
11 12
 import { AudioLevelIndicator } from '../../../react/features/audio-level-indicator';
12 13
 import { Avatar as AvatarDisplay } from '../../../react/features/base/avatar';
13 14
 import { i18next } from '../../../react/features/base/i18n';
@@ -512,6 +513,18 @@ export default class SmallVideo {
512 513
         if (this.displayMode !== oldDisplayMode) {
513 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 Parādīt failu

@@ -588,6 +588,19 @@ export function createScreenSharingEvent(action) {
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 605
  * The local participant failed to send a "selected endpoint" message to the
593 606
  * bridge.

Notiek ielāde…
Atcelt
Saglabāt