瀏覽代碼

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

j8
hmuresan 3 年之前
父節點
當前提交
f2f545a57f

+ 3
- 6
react/features/connection-indicator/components/web/ConnectionIndicator.js 查看文件

92
      */
92
      */
93
     iconSize: number,
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
      * Relative to the icon from where the popover for more connection details
96
      * Relative to the icon from where the popover for more connection details
102
      * should display.
97
      * should display.
149
         return (
144
         return (
150
             <Popover
145
             <Popover
151
                 className = { rootClassNames }
146
                 className = { rootClassNames }
152
-                content = { <ConnectionIndicatorContent participantId = { this.props.participantId } /> }
147
+                content = { <ConnectionIndicatorContent
148
+                    inheritedStats = { this.state.stats }
149
+                    participantId = { this.props.participantId } /> }
153
                 disablePopover = { !this.props.enableStatsDisplay }
150
                 disablePopover = { !this.props.enableStatsDisplay }
154
                 position = { this.props.statsPopoverPosition }>
151
                 position = { this.props.statsPopoverPosition }>
155
                 <div className = 'popover-trigger'>
152
                 <div className = 'popover-trigger'>

+ 36
- 30
react/features/connection-indicator/components/web/ConnectionIndicatorContent.js 查看文件

58
  */
58
  */
59
 type Props = AbstractProps & {
59
 type Props = AbstractProps & {
60
 
60
 
61
+    /**
62
+     * The audio SSRC of this client.
63
+     */
64
+     _audioSsrc: number,
65
+
61
     /**
66
     /**
62
      * The current condition of the user's connection, matching one of the
67
      * The current condition of the user's connection, matching one of the
63
      * enumerated values in the library.
68
      * enumerated values in the library.
65
     _connectionStatus: string,
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
             autoHideTimeout: undefined,
148
             autoHideTimeout: undefined,
144
             showIndicator: false,
149
             showIndicator: false,
145
             showMoreStats: false,
150
             showMoreStats: false,
146
-            stats: {}
151
+            stats: props.inheritedStats || {}
147
         };
152
         };
148
 
153
 
149
         // Bind event handlers so they are only bound once for every instance.
154
         // Bind event handlers so they are only bound once for every instance.
174
 
179
 
175
         return (
180
         return (
176
             <ConnectionStatsTable
181
             <ConnectionStatsTable
177
-                audioSsrc = { this.props.audioSsrc }
182
+                audioSsrc = { this.props._audioSsrc }
178
                 bandwidth = { bandwidth }
183
                 bandwidth = { bandwidth }
179
                 bitrate = { bitrate }
184
                 bitrate = { bitrate }
180
                 bridgeCount = { bridgeCount }
185
                 bridgeCount = { bridgeCount }
181
                 codec = { codec }
186
                 codec = { codec }
182
                 connectionSummary = { this._getConnectionStatusTip() }
187
                 connectionSummary = { this._getConnectionStatusTip() }
183
-                disableShowMoreStats = { this.props.disableShowMoreStats }
188
+                disableShowMoreStats = { this.props._disableShowMoreStats }
184
                 e2eRtt = { e2eRtt }
189
                 e2eRtt = { e2eRtt }
185
-                enableSaveLogs = { this.props.enableSaveLogs }
190
+                enableSaveLogs = { this.props._enableSaveLogs }
186
                 framerate = { framerate }
191
                 framerate = { framerate }
187
-                isLocalVideo = { this.props.isLocalVideo }
192
+                isLocalVideo = { this.props._isLocalVideo }
188
                 maxEnabledResolution = { maxEnabledResolution }
193
                 maxEnabledResolution = { maxEnabledResolution }
189
                 onSaveLogs = { this.props._onSaveLogs }
194
                 onSaveLogs = { this.props._onSaveLogs }
190
                 onShowMore = { this._onToggleShowMore }
195
                 onShowMore = { this._onToggleShowMore }
195
                 serverRegion = { serverRegion }
200
                 serverRegion = { serverRegion }
196
                 shouldShowMore = { this.state.showMoreStats }
201
                 shouldShowMore = { this.state.showMoreStats }
197
                 transport = { transport }
202
                 transport = { transport }
198
-                videoSsrc = { this.props.videoSsrc } />
203
+                videoSsrc = { this.props._videoSsrc } />
199
         );
204
         );
200
     }
205
     }
201
 
206
 
303
         = participantId ? getParticipantById(state, participantId) : getLocalParticipant(state);
308
         = participantId ? getParticipantById(state, participantId) : getLocalParticipant(state);
304
     const props = {
309
     const props = {
305
         _connectionStatus: participant?.connectionStatus,
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
     if (conference) {
316
     if (conference) {
315
 
321
 
316
         return {
322
         return {
317
             ...props,
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
         } = this.props;
652
         } = this.props;
653
         const { isHovered } = this.state;
653
         const { isHovered } = this.state;
654
         const showConnectionIndicator = isHovered || !_connectionIndicatorAutoHideEnabled;
654
         const showConnectionIndicator = isHovered || !_connectionIndicatorAutoHideEnabled;
655
-        const { id, local = false, dominantSpeaker = false } = _participant;
655
+        const { id, dominantSpeaker = false } = _participant;
656
         const showDominantSpeaker = !_isDominantSpeakerDisabled && dominantSpeaker;
656
         const showDominantSpeaker = !_isDominantSpeakerDisabled && dominantSpeaker;
657
         let statsPopoverPosition, tooltipPosition;
657
         let statsPopoverPosition, tooltipPosition;
658
 
658
 
677
                         alwaysVisible = { showConnectionIndicator }
677
                         alwaysVisible = { showConnectionIndicator }
678
                         enableStatsDisplay = { true }
678
                         enableStatsDisplay = { true }
679
                         iconSize = { iconSize }
679
                         iconSize = { iconSize }
680
-                        isLocalVideo = { local }
681
                         participantId = { id }
680
                         participantId = { id }
682
                         statsPopoverPosition = { statsPopoverPosition } />
681
                         statsPopoverPosition = { statsPopoverPosition } />
683
                 }
682
                 }

Loading…
取消
儲存