瀏覽代碼

fix(remoteVideo): Attaching video stream.

j8
Hristo Terezov 5 年之前
父節點
當前提交
99de9d0bfa
共有 2 個文件被更改,包括 41 次插入5 次删除
  1. 26
    5
      modules/UI/videolayout/RemoteVideo.js
  2. 15
    0
      react/features/analytics/AnalyticsEvents.js

+ 26
- 5
modules/UI/videolayout/RemoteVideo.js 查看文件

@@ -7,6 +7,7 @@ import { Provider } from 'react-redux';
7 7
 import { I18nextProvider } from 'react-i18next';
8 8
 import { AtlasKitThemeProvider } from '@atlaskit/theme';
9 9
 
10
+import { createThumbnailOffsetParentIsNullEvent, sendAnalytics } from '../../../react/features/analytics';
10 11
 import { i18next } from '../../../react/features/base/i18n';
11 12
 import {
12 13
     JitsiParticipantConnectionStatus
@@ -512,11 +513,31 @@ RemoteVideo.prototype.addRemoteStreamElement = function(stream) {
512 513
 
513 514
     $(streamElement).hide();
514 515
 
515
-    // If the container is currently visible
516
-    // we attach the stream to the element.
517
-    if (!isVideo || (this.container.offsetParent !== null && isVideo)) {
518
-        this.waitForPlayback(streamElement, stream);
519
-        stream.attach(streamElement);
516
+    this.waitForPlayback(streamElement, stream);
517
+    stream.attach(streamElement);
518
+
519
+    // TODO: Remove once we verify that this.container.offsetParent === null was the reason for not attached video
520
+    // streams to the thumbnail.
521
+    if (isVideo && this.container.offsetParent === null) {
522
+        sendAnalytics(createThumbnailOffsetParentIsNullEvent(this.id));
523
+        const parentNodesDisplayProps = [
524
+            '#filmstripRemoteVideosContainer',
525
+            '#filmstripRemoteVideos',
526
+            '#remoteVideos',
527
+            '.filmstrip',
528
+            '#videospace',
529
+            '#videoconference_page',
530
+            '#react'
531
+        ].map(selector => `${selector} - ${$(selector).css('display')}`);
532
+        const videoConferencePageParent = $('#videoconference_page').parent();
533
+        const reactDiv = document.getElementById('react');
534
+
535
+        parentNodesDisplayProps.push(
536
+            `${videoConferencePageParent.attr('class')} - ${videoConferencePageParent.css('display')}`);
537
+        parentNodesDisplayProps.push(`this.container - ${this.$container.css('display')}`);
538
+        logger.debug(`this.container.offsetParent is null [user: ${this.id}, ${
539
+            parentNodesDisplayProps.join(', ')}, #react.offsetParent - ${
540
+            reactDiv && reactDiv.offsetParent !== null ? 'not null' : 'null'}]`);
520 541
     }
521 542
 
522 543
     if (!isVideo) {

+ 15
- 0
react/features/analytics/AnalyticsEvents.js 查看文件

@@ -692,6 +692,21 @@ export function createSyncTrackStateEvent(mediaType, muted) {
692 692
     };
693 693
 }
694 694
 
695
+/**
696
+ * Creates an event that indicates the thumbnail offset parent is null.
697
+ *
698
+ * @param {string} id - The id of the user related to the thumbnail.
699
+ * @returns {Object} The event in a format suitable for sending via sendAnalytics.
700
+ */
701
+export function createThumbnailOffsetParentIsNullEvent(id) {
702
+    return {
703
+        action: 'OffsetParentIsNull',
704
+        attributes: {
705
+            id
706
+        }
707
+    };
708
+}
709
+
695 710
 /**
696 711
  * Creates an event associated with a toolbar button being clicked/pressed. By
697 712
  * convention, where appropriate an attribute named 'enable' should be used to

Loading…
取消
儲存