Sfoglia il codice sorgente

fix(large-video) Fix an infinite loop with source name signaling enabled (#11486)

* fix large video updating loop when kicked out

* fix linter issue
master
pangrr 3 anni fa
parent
commit
b872ea855e
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 17 aggiunte e 3 eliminazioni
  1. 17
    3
      modules/UI/videolayout/LargeVideoManager.js

+ 17
- 3
modules/UI/videolayout/LargeVideoManager.js Vedi File

@@ -160,6 +160,18 @@ export default class LargeVideoManager {
160 160
         this.videoContainer.removeResizeListener(
161 161
             this._onVideoResolutionUpdate);
162 162
 
163
+        if (getSourceNameSignalingFeatureFlag(APP.store.getState())) {
164
+            // Remove track streaming status listener.
165
+            // TODO: when this class is converted to a function react component,
166
+            // use a custom hook to update a local track streaming status.
167
+            if (this.videoTrack && !this.videoTrack.local) {
168
+                this.videoTrack.jitsiTrack.off(JitsiTrackEvents.TRACK_STREAMING_STATUS_CHANGED,
169
+                    this.handleTrackStreamingStatusChanged);
170
+                APP.store.dispatch(trackStreamingStatusChanged(this.videoTrack.jitsiTrack,
171
+                    this.videoTrack.jitsiTrack.getTrackStreamingStatus()));
172
+            }
173
+        }
174
+
163 175
         this.removePresenceLabel();
164 176
 
165 177
         ReactDOM.unmountComponentAtNode(this._dominantSpeakerAvatarContainer);
@@ -260,14 +272,16 @@ export default class LargeVideoManager {
260 272
                 // TODO: when this class is converted to a function react component,
261 273
                 // use a custom hook to update a local track streaming status.
262 274
                 if (this.videoTrack?.jitsiTrack?.getSourceName() !== videoTrack?.jitsiTrack?.getSourceName()) {
263
-                    if (this.videoTrack) {
275
+                    if (this.videoTrack && !this.videoTrack.local) {
264 276
                         this.videoTrack.jitsiTrack.off(JitsiTrackEvents.TRACK_STREAMING_STATUS_CHANGED,
265 277
                             this.handleTrackStreamingStatusChanged);
266 278
                         APP.store.dispatch(trackStreamingStatusChanged(this.videoTrack.jitsiTrack,
267 279
                             this.videoTrack.jitsiTrack.getTrackStreamingStatus()));
268 280
                     }
269
-                    if (videoTrack && !videoTrack.local) {
270
-                        this.videoTrack = videoTrack;
281
+
282
+                    this.videoTrack = videoTrack;
283
+
284
+                    if (this.videoTrack && !this.videoTrack.local) {
271 285
                         this.videoTrack.jitsiTrack.on(JitsiTrackEvents.TRACK_STREAMING_STATUS_CHANGED,
272 286
                             this.handleTrackStreamingStatusChanged);
273 287
                         APP.store.dispatch(trackStreamingStatusChanged(this.videoTrack.jitsiTrack,

Loading…
Annulla
Salva