Browse Source

Clears remoteStream when user leaves.

master
damencho 9 years ago
parent
commit
ad92eb5a08
2 changed files with 9 additions and 1 deletions
  1. 3
    0
      JitsiConference.js
  2. 6
    1
      modules/RTC/RTC.js

+ 3
- 0
JitsiConference.js View File

490
     }
490
     }
491
     var participant = this.participants[id];
491
     var participant = this.participants[id];
492
     delete this.participants[id];
492
     delete this.participants[id];
493
+
494
+    this.rtc.removeRemoteStream(id);
495
+
493
     this.eventEmitter.emit(JitsiConferenceEvents.USER_LEFT, id, participant);
496
     this.eventEmitter.emit(JitsiConferenceEvents.USER_LEFT, id, participant);
494
 };
497
 };
495
 
498
 

+ 6
- 1
modules/RTC/RTC.js View File

30
 function RTC(room, options) {
30
 function RTC(room, options) {
31
     this.room = room;
31
     this.room = room;
32
     this.localStreams = [];
32
     this.localStreams = [];
33
-    //FIXME: we should start removing those streams.
34
     //FIXME: We should support multiple streams per jid.
33
     //FIXME: We should support multiple streams per jid.
35
     this.remoteStreams = {};
34
     this.remoteStreams = {};
36
     this.localAudio = null;
35
     this.localAudio = null;
183
     return remoteStream;
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
 RTC.getPCConstraints = function () {
191
 RTC.getPCConstraints = function () {
187
     return RTCUtils.pc_constraints;
192
     return RTCUtils.pc_constraints;
188
 };
193
 };

Loading…
Cancel
Save