Преглед на файлове

fix(connection-indicator) Fix detecting local/remote participant

j8
hmuresan преди 3 години
родител
ревизия
f2f545a57f

+ 3
- 6
react/features/connection-indicator/components/web/ConnectionIndicator.js Целия файл

@@ -92,11 +92,6 @@ type Props = AbstractProps & {
92 92
      */
93 93
     iconSize: number,
94 94
 
95
-    /**
96
-     * Whether or not the displays stats are for local video.
97
-     */
98
-    isLocalVideo: boolean,
99
-
100 95
     /**
101 96
      * Relative to the icon from where the popover for more connection details
102 97
      * should display.
@@ -149,7 +144,9 @@ class ConnectionIndicator extends AbstractConnectionIndicator<Props, AbstractSta
149 144
         return (
150 145
             <Popover
151 146
                 className = { rootClassNames }
152
-                content = { <ConnectionIndicatorContent participantId = { this.props.participantId } /> }
147
+                content = { <ConnectionIndicatorContent
148
+                    inheritedStats = { this.state.stats }
149
+                    participantId = { this.props.participantId } /> }
153 150
                 disablePopover = { !this.props.enableStatsDisplay }
154 151
                 position = { this.props.statsPopoverPosition }>
155 152
                 <div className = 'popover-trigger'>

+ 36
- 30
react/features/connection-indicator/components/web/ConnectionIndicatorContent.js Целия файл

@@ -58,6 +58,11 @@ const QUALITY_TO_WIDTH: Array<Object> = [
58 58
  */
59 59
 type Props = AbstractProps & {
60 60
 
61
+    /**
62
+     * The audio SSRC of this client.
63
+     */
64
+     _audioSsrc: number,
65
+
61 66
     /**
62 67
      * The current condition of the user's connection, matching one of the
63 68
      * enumerated values in the library.
@@ -65,51 +70,51 @@ type Props = AbstractProps & {
65 70
     _connectionStatus: string,
66 71
 
67 72
     /**
68
-     * The audio SSRC of this client.
73
+     * Whether or not should display the "Show More" link in the local video
74
+     * stats table.
69 75
      */
70
-    audioSsrc: number,
76
+    _disableShowMoreStats: boolean,
71 77
 
72 78
     /**
73
-     * Css class to apply on container
79
+     * Whether or not should display the "Save Logs" link in the local video
80
+     * stats table.
74 81
      */
75
-    className: string,
82
+    _enableSaveLogs: boolean,
76 83
 
77 84
     /**
78
-     * The Redux dispatch function.
85
+     * Whether or not the displays stats are for local video.
79 86
      */
80
-    dispatch: Dispatch<any>,
87
+    _isLocalVideo: boolean,
81 88
 
82 89
     /**
83
-     * Whether or not should display the "Show More" link in the local video
84
-     * stats table.
90
+     * Invoked to save the conference logs.
85 91
      */
86
-    disableShowMoreStats: boolean,
92
+    _onSaveLogs: Function,
87 93
 
88 94
     /**
89
-     * Whether or not should display the "Save Logs" link in the local video
90
-     * stats table.
95
+     * The video SSRC of this client.
91 96
      */
92
-    enableSaveLogs: boolean,
97
+    _videoSsrc: number,
93 98
 
94 99
     /**
95
-     * Whether or not the displays stats are for local video.
100
+     * Css class to apply on container
96 101
      */
97
-    isLocalVideo: boolean,
102
+    className: string,
98 103
 
99 104
     /**
100
-     * Invoked to obtain translated strings.
105
+     * The Redux dispatch function.
101 106
      */
102
-    t: Function,
107
+    dispatch: Dispatch<any>,
103 108
 
104 109
     /**
105
-     * The video SSRC of this client.
110
+     * Optional param for passing existing connection stats on component instantiation
106 111
      */
107
-    videoSsrc: number,
112
+    inheritedStats: Object,
108 113
 
109 114
     /**
110
-     * Invoked to save the conference logs.
115
+     * Invoked to obtain translated strings.
111 116
      */
112
-    _onSaveLogs: Function
117
+    t: Function
113 118
 };
114 119
 
115 120
 /**
@@ -143,7 +148,7 @@ class ConnectionIndicatorContent extends AbstractConnectionIndicator<Props, Stat
143 148
             autoHideTimeout: undefined,
144 149
             showIndicator: false,
145 150
             showMoreStats: false,
146
-            stats: {}
151
+            stats: props.inheritedStats || {}
147 152
         };
148 153
 
149 154
         // Bind event handlers so they are only bound once for every instance.
@@ -174,17 +179,17 @@ class ConnectionIndicatorContent extends AbstractConnectionIndicator<Props, Stat
174 179
 
175 180
         return (
176 181
             <ConnectionStatsTable
177
-                audioSsrc = { this.props.audioSsrc }
182
+                audioSsrc = { this.props._audioSsrc }
178 183
                 bandwidth = { bandwidth }
179 184
                 bitrate = { bitrate }
180 185
                 bridgeCount = { bridgeCount }
181 186
                 codec = { codec }
182 187
                 connectionSummary = { this._getConnectionStatusTip() }
183
-                disableShowMoreStats = { this.props.disableShowMoreStats }
188
+                disableShowMoreStats = { this.props._disableShowMoreStats }
184 189
                 e2eRtt = { e2eRtt }
185
-                enableSaveLogs = { this.props.enableSaveLogs }
190
+                enableSaveLogs = { this.props._enableSaveLogs }
186 191
                 framerate = { framerate }
187
-                isLocalVideo = { this.props.isLocalVideo }
192
+                isLocalVideo = { this.props._isLocalVideo }
188 193
                 maxEnabledResolution = { maxEnabledResolution }
189 194
                 onSaveLogs = { this.props._onSaveLogs }
190 195
                 onShowMore = { this._onToggleShowMore }
@@ -195,7 +200,7 @@ class ConnectionIndicatorContent extends AbstractConnectionIndicator<Props, Stat
195 200
                 serverRegion = { serverRegion }
196 201
                 shouldShowMore = { this.state.showMoreStats }
197 202
                 transport = { transport }
198
-                videoSsrc = { this.props.videoSsrc } />
203
+                videoSsrc = { this.props._videoSsrc } />
199 204
         );
200 205
     }
201 206
 
@@ -303,8 +308,9 @@ export function _mapStateToProps(state: Object, ownProps: Props) {
303 308
         = participantId ? getParticipantById(state, participantId) : getLocalParticipant(state);
304 309
     const props = {
305 310
         _connectionStatus: participant?.connectionStatus,
306
-        enableSaveLogs: state['features/base/config'].enableSaveLogs,
307
-        disableShowMoreStats: state['features/base/config'].disableShowMoreStats
311
+        _enableSaveLogs: state['features/base/config'].enableSaveLogs,
312
+        _disableShowMoreStats: state['features/base/config'].disableShowMoreStats,
313
+        _isLocalVideo: participant?.local
308 314
     };
309 315
 
310 316
     if (conference) {
@@ -315,8 +321,8 @@ export function _mapStateToProps(state: Object, ownProps: Props) {
315 321
 
316 322
         return {
317 323
             ...props,
318
-            audioSsrc: firstAudioTrack ? conference.getSsrcByTrack(firstAudioTrack.jitsiTrack) : undefined,
319
-            videoSsrc: firstVideoTrack ? conference.getSsrcByTrack(firstVideoTrack.jitsiTrack) : undefined
324
+            _audioSsrc: firstAudioTrack ? conference.getSsrcByTrack(firstAudioTrack.jitsiTrack) : undefined,
325
+            _videoSsrc: firstVideoTrack ? conference.getSsrcByTrack(firstVideoTrack.jitsiTrack) : undefined
320 326
         };
321 327
     }
322 328
 

+ 1
- 2
react/features/filmstrip/components/web/Thumbnail.js Целия файл

@@ -652,7 +652,7 @@ class Thumbnail extends Component<Props, State> {
652 652
         } = this.props;
653 653
         const { isHovered } = this.state;
654 654
         const showConnectionIndicator = isHovered || !_connectionIndicatorAutoHideEnabled;
655
-        const { id, local = false, dominantSpeaker = false } = _participant;
655
+        const { id, dominantSpeaker = false } = _participant;
656 656
         const showDominantSpeaker = !_isDominantSpeakerDisabled && dominantSpeaker;
657 657
         let statsPopoverPosition, tooltipPosition;
658 658
 
@@ -677,7 +677,6 @@ class Thumbnail extends Component<Props, State> {
677 677
                         alwaysVisible = { showConnectionIndicator }
678 678
                         enableStatsDisplay = { true }
679 679
                         iconSize = { iconSize }
680
-                        isLocalVideo = { local }
681 680
                         participantId = { id }
682 681
                         statsPopoverPosition = { statsPopoverPosition } />
683 682
                 }

Loading…
Отказ
Запис