Procházet zdrojové kódy

Clears remoteStream when user leaves.

master
damencho před 9 roky
rodič
revize
ad92eb5a08
2 změnil soubory, kde provedl 9 přidání a 1 odebrání
  1. 3
    0
      JitsiConference.js
  2. 6
    1
      modules/RTC/RTC.js

+ 3
- 0
JitsiConference.js Zobrazit soubor

@@ -490,6 +490,9 @@ JitsiConference.prototype.onMemberLeft = function (jid) {
490 490
     }
491 491
     var participant = this.participants[id];
492 492
     delete this.participants[id];
493
+
494
+    this.rtc.removeRemoteStream(id);
495
+
493 496
     this.eventEmitter.emit(JitsiConferenceEvents.USER_LEFT, id, participant);
494 497
 };
495 498
 

+ 6
- 1
modules/RTC/RTC.js Zobrazit soubor

@@ -30,7 +30,6 @@ function createLocalTracks(streams, options) {
30 30
 function RTC(room, options) {
31 31
     this.room = room;
32 32
     this.localStreams = [];
33
-    //FIXME: we should start removing those streams.
34 33
     //FIXME: We should support multiple streams per jid.
35 34
     this.remoteStreams = {};
36 35
     this.localAudio = null;
@@ -183,6 +182,12 @@ RTC.prototype.createRemoteStream = function (data, sid, thessrc) {
183 182
     return remoteStream;
184 183
 };
185 184
 
185
+RTC.prototype.removeRemoteStream = function (resource) {
186
+    if(this.remoteStreams[resource]) {
187
+        delete this.remoteStreams[resource];
188
+    }
189
+};
190
+
186 191
 RTC.getPCConstraints = function () {
187 192
     return RTCUtils.pc_constraints;
188 193
 };

Načítá se…
Zrušit
Uložit