|
|
@@ -37,7 +37,6 @@ function JitsiLocalTrack(stream, track, mediaType, videoType, resolution,
|
|
37
|
37
|
this.resolution = resolution;
|
|
38
|
38
|
this.deviceId = deviceId;
|
|
39
|
39
|
this.startMuted = false;
|
|
40
|
|
- this.disposed = false;
|
|
41
|
40
|
this.initialMSID = this.getMSID();
|
|
42
|
41
|
this.inMuteOrUnmuteProgress = false;
|
|
43
|
42
|
|
|
|
@@ -251,6 +250,7 @@ JitsiLocalTrack.prototype._setMute = function (mute, resolve, reject) {
|
|
251
|
250
|
}
|
|
252
|
251
|
|
|
253
|
252
|
if(!streamInfo) {
|
|
|
253
|
+ // FIXME: introduce new JitsiTrackError for that
|
|
254
|
254
|
reject(new Error('track.no_stream_found'));
|
|
255
|
255
|
return;
|
|
256
|
256
|
}
|
|
|
@@ -287,9 +287,12 @@ JitsiLocalTrack.prototype._setMute = function (mute, resolve, reject) {
|
|
287
|
287
|
/**
|
|
288
|
288
|
* Stops sending the media track. And removes it from the HTML.
|
|
289
|
289
|
* NOTE: Works for local tracks only.
|
|
|
290
|
+ *
|
|
|
291
|
+ * @extends JitsiTrack#dispose
|
|
290
|
292
|
* @returns {Promise}
|
|
291
|
293
|
*/
|
|
292
|
294
|
JitsiLocalTrack.prototype.dispose = function () {
|
|
|
295
|
+ var self = this;
|
|
293
|
296
|
var promise = Promise.resolve();
|
|
294
|
297
|
|
|
295
|
298
|
if (this.conference){
|
|
|
@@ -301,8 +304,6 @@ JitsiLocalTrack.prototype.dispose = function () {
|
|
301
|
304
|
this.detach();
|
|
302
|
305
|
}
|
|
303
|
306
|
|
|
304
|
|
- this.disposed = true;
|
|
305
|
|
-
|
|
306
|
307
|
RTCUtils.removeListener(RTCEvents.DEVICE_LIST_CHANGED,
|
|
307
|
308
|
this._onDeviceListChanged);
|
|
308
|
309
|
|
|
|
@@ -311,7 +312,10 @@ JitsiLocalTrack.prototype.dispose = function () {
|
|
311
|
312
|
this._onAudioOutputDeviceChanged);
|
|
312
|
313
|
}
|
|
313
|
314
|
|
|
314
|
|
- return promise;
|
|
|
315
|
+ return promise
|
|
|
316
|
+ .then(function() {
|
|
|
317
|
+ return JitsiTrack.prototype.dispose.call(self);
|
|
|
318
|
+ });
|
|
315
|
319
|
};
|
|
316
|
320
|
|
|
317
|
321
|
/**
|