Browse Source

Adds check for room when removing track from conference

master
hristoterezov 10 years ago
parent
commit
472de3dd74
2 changed files with 10 additions and 0 deletions
  1. 5
    0
      JitsiConference.js
  2. 5
    0
      lib-jitsi-meet.js

+ 5
- 0
JitsiConference.js View File

223
  * @param track the JitsiLocalTrack object.
223
  * @param track the JitsiLocalTrack object.
224
  */
224
  */
225
 JitsiConference.prototype.removeTrack = function (track) {
225
 JitsiConference.prototype.removeTrack = function (track) {
226
+    if(!this.room){
227
+        if(this.rtc)
228
+            this.rtc.removeLocalStream(track);
229
+        return;
230
+    }
226
     this.room.removeStream(track.getOriginalStream(), function(){
231
     this.room.removeStream(track.getOriginalStream(), function(){
227
         this.rtc.removeLocalStream(track);
232
         this.rtc.removeLocalStream(track);
228
         this.eventEmitter.emit(JitsiConferenceEvents.TRACK_REMOVED, track);
233
         this.eventEmitter.emit(JitsiConferenceEvents.TRACK_REMOVED, track);

+ 5
- 0
lib-jitsi-meet.js View File

225
  * @param track the JitsiLocalTrack object.
225
  * @param track the JitsiLocalTrack object.
226
  */
226
  */
227
 JitsiConference.prototype.removeTrack = function (track) {
227
 JitsiConference.prototype.removeTrack = function (track) {
228
+    if(!this.room){
229
+        if(this.rtc)
230
+            this.rtc.removeLocalStream(track);
231
+        return;
232
+    }
228
     this.room.removeStream(track.getOriginalStream(), function(){
233
     this.room.removeStream(track.getOriginalStream(), function(){
229
         this.rtc.removeLocalStream(track);
234
         this.rtc.removeLocalStream(track);
230
         this.eventEmitter.emit(JitsiConferenceEvents.TRACK_REMOVED, track);
235
         this.eventEmitter.emit(JitsiConferenceEvents.TRACK_REMOVED, track);

Loading…
Cancel
Save