|
@@ -69,6 +69,16 @@ function JitsiLocalTrack(stream, track, mediaType, videoType, resolution,
|
69
|
69
|
}
|
70
|
70
|
};
|
71
|
71
|
|
|
72
|
+ // Subscribe each created local audio track to
|
|
73
|
+ // RTCEvents.AUDIO_OUTPUT_DEVICE_CHANGED event. This is different from
|
|
74
|
+ // handling this event for remote tracks (which are handled in RTC.js),
|
|
75
|
+ // because there might be local tracks not attached to a conference.
|
|
76
|
+ if (this.isAudioTrack() && RTCUtils.isDeviceChangeAvailable('output')) {
|
|
77
|
+ this._onAudioOutputDeviceChanged = this.setAudioOutput.bind(this);
|
|
78
|
+
|
|
79
|
+ RTCUtils.addListener(RTCEvents.AUDIO_OUTPUT_DEVICE_CHANGED,
|
|
80
|
+ this._onAudioOutputDeviceChanged);
|
|
81
|
+ }
|
72
|
82
|
|
73
|
83
|
RTCUtils.addListener(RTCEvents.DEVICE_LIST_CHANGED,
|
74
|
84
|
this._onDeviceListChanged);
|
|
@@ -288,6 +298,11 @@ JitsiLocalTrack.prototype.dispose = function () {
|
288
|
298
|
RTCUtils.removeListener(RTCEvents.DEVICE_LIST_CHANGED,
|
289
|
299
|
this._onDeviceListChanged);
|
290
|
300
|
|
|
301
|
+ if (this._onAudioOutputDeviceChanged) {
|
|
302
|
+ RTCUtils.removeListener(RTCEvents.AUDIO_OUTPUT_DEVICE_CHANGED,
|
|
303
|
+ this._onAudioOutputDeviceChanged);
|
|
304
|
+ }
|
|
305
|
+
|
291
|
306
|
return promise;
|
292
|
307
|
};
|
293
|
308
|
|