|
@@ -1,4 +1,4 @@
|
1
|
|
-/* global APP, $ */
|
|
1
|
+/* global APP, $, JitsiMeetJS */
|
2
|
2
|
import UIUtil from "../../util/UIUtil";
|
3
|
3
|
import UIEvents from "../../../../service/UI/UIEvents";
|
4
|
4
|
import languages from "../../../../service/translation/languages";
|
|
@@ -124,6 +124,13 @@ export default {
|
124
|
124
|
emitter.emit(UIEvents.AUDIO_DEVICE_CHANGED, micDeviceId);
|
125
|
125
|
}
|
126
|
126
|
});
|
|
127
|
+ $('#selectAudioOutput').change(function () {
|
|
128
|
+ let audioOutputDeviceId = $(this).val();
|
|
129
|
+ if (audioOutputDeviceId !== Settings.getAudioOutputDeviceId()) {
|
|
130
|
+ emitter.emit(UIEvents.AUDIO_OUTPUT_DEVICE_CHANGED,
|
|
131
|
+ audioOutputDeviceId);
|
|
132
|
+ }
|
|
133
|
+ });
|
127
|
134
|
},
|
128
|
135
|
|
129
|
136
|
/**
|
|
@@ -186,21 +193,41 @@ export default {
|
186
|
193
|
* @param {{ deviceId, label, kind }[]} devices list of available devices
|
187
|
194
|
*/
|
188
|
195
|
changeDevicesList (devices) {
|
|
196
|
+ let $devicesOptions = $('#devicesOptions');
|
|
197
|
+
|
189
|
198
|
if (!devices.length) {
|
190
|
|
- $('#devicesOptions').hide();
|
|
199
|
+ $devicesOptions.hide();
|
191
|
200
|
return;
|
192
|
201
|
}
|
193
|
202
|
|
|
203
|
+ let $selectCamera= $('#selectCamera'),
|
|
204
|
+ $selectMic = $('#selectMic'),
|
|
205
|
+ $selectAudioOutput = $('#selectAudioOutput'),
|
|
206
|
+ $selectAudioOutputParent = $selectAudioOutput.parent();
|
|
207
|
+
|
194
|
208
|
let audio = devices.filter(device => device.kind === 'audioinput');
|
195
|
209
|
let video = devices.filter(device => device.kind === 'videoinput');
|
|
210
|
+ let audioOutput = devices
|
|
211
|
+ .filter(device => device.kind === 'audiooutput');
|
196
|
212
|
|
197
|
|
- $('#selectCamera').html(
|
|
213
|
+ $selectCamera.html(
|
198
|
214
|
generateDevicesOptions(video, Settings.getCameraDeviceId())
|
199
|
215
|
);
|
200
|
|
- $('#selectMic').html(
|
|
216
|
+ $selectMic.html(
|
201
|
217
|
generateDevicesOptions(audio, Settings.getMicDeviceId())
|
202
|
218
|
);
|
203
|
219
|
|
204
|
|
- $('#devicesOptions').show();
|
|
220
|
+ if (audioOutput.length &&
|
|
221
|
+ JitsiMeetJS.isDeviceChangeAvailable('output')) {
|
|
222
|
+ $selectAudioOutput.html(
|
|
223
|
+ generateDevicesOptions(audioOutput,
|
|
224
|
+ Settings.getAudioOutputDeviceId()));
|
|
225
|
+
|
|
226
|
+ $selectAudioOutputParent.show();
|
|
227
|
+ } else {
|
|
228
|
+ $selectAudioOutputParent.hide();
|
|
229
|
+ }
|
|
230
|
+
|
|
231
|
+ $devicesOptions.show();
|
205
|
232
|
}
|
206
|
233
|
};
|