Adds check for room when removing track from conference

This commit is contained in:
hristoterezov 2015-12-17 13:45:50 +11:00
parent ceb26cf74a
commit c1867a64e0
2 changed files with 10 additions and 0 deletions

View File

@ -223,6 +223,11 @@ JitsiConference.prototype._fireMuteChangeEvent = function (track) {
* @param track the JitsiLocalTrack object.
*/
JitsiConference.prototype.removeTrack = function (track) {
if(!this.room){
if(this.rtc)
this.rtc.removeLocalStream(track);
return;
}
this.room.removeStream(track.getOriginalStream(), function(){
this.rtc.removeLocalStream(track);
this.eventEmitter.emit(JitsiConferenceEvents.TRACK_REMOVED, track);

View File

@ -225,6 +225,11 @@ JitsiConference.prototype._fireMuteChangeEvent = function (track) {
* @param track the JitsiLocalTrack object.
*/
JitsiConference.prototype.removeTrack = function (track) {
if(!this.room){
if(this.rtc)
this.rtc.removeLocalStream(track);
return;
}
this.room.removeStream(track.getOriginalStream(), function(){
this.rtc.removeLocalStream(track);
this.eventEmitter.emit(JitsiConferenceEvents.TRACK_REMOVED, track);