|
|
@@ -17,6 +17,7 @@ import {
|
|
17
|
17
|
import {
|
|
18
|
18
|
areDeviceLabelsInitialized,
|
|
19
|
19
|
getDeviceIdByLabel,
|
|
|
20
|
+ getDeviceLabelById,
|
|
20
|
21
|
getDevicesFromURL,
|
|
21
|
22
|
setAudioOutputDeviceId
|
|
22
|
23
|
} from './functions';
|
|
|
@@ -216,6 +217,25 @@ export function setAudioInputDevice(deviceId) {
|
|
216
|
217
|
};
|
|
217
|
218
|
}
|
|
218
|
219
|
|
|
|
220
|
+/**
|
|
|
221
|
+ * Sets the audio input device id and updates the settings
|
|
|
222
|
+ * so they are persisted across sessions.
|
|
|
223
|
+ *
|
|
|
224
|
+ * @param {string} deviceId - The id of the new audio input device.
|
|
|
225
|
+ * @returns {Function}
|
|
|
226
|
+ */
|
|
|
227
|
+export function setAudioInputDeviceAndUpdateSettings(deviceId) {
|
|
|
228
|
+ return function(dispatch, getState) {
|
|
|
229
|
+ const deviceLabel = getDeviceLabelById(getState(), deviceId, 'audioInput');
|
|
|
230
|
+
|
|
|
231
|
+ dispatch(setAudioInputDevice(deviceId));
|
|
|
232
|
+ dispatch(updateSettings({
|
|
|
233
|
+ userSelectedMicDeviceId: deviceId,
|
|
|
234
|
+ userSelectedMicDeviceLabel: deviceLabel
|
|
|
235
|
+ }));
|
|
|
236
|
+ };
|
|
|
237
|
+}
|
|
|
238
|
+
|
|
219
|
239
|
/**
|
|
220
|
240
|
* Updates the output device id.
|
|
221
|
241
|
*
|
|
|
@@ -244,6 +264,25 @@ export function setVideoInputDevice(deviceId) {
|
|
244
|
264
|
};
|
|
245
|
265
|
}
|
|
246
|
266
|
|
|
|
267
|
+/**
|
|
|
268
|
+ * Sets the video input device id and updates the settings
|
|
|
269
|
+ * so they are persisted across sessions.
|
|
|
270
|
+ *
|
|
|
271
|
+ * @param {string} deviceId - The id of the new video input device.
|
|
|
272
|
+ * @returns {Function}
|
|
|
273
|
+ */
|
|
|
274
|
+export function setVideoInputDeviceAndUpdateSettings(deviceId) {
|
|
|
275
|
+ return function(dispatch, getState) {
|
|
|
276
|
+ const deviceLabel = getDeviceLabelById(getState(), deviceId, 'videoInput');
|
|
|
277
|
+
|
|
|
278
|
+ dispatch(setVideoInputDevice(deviceId));
|
|
|
279
|
+ dispatch(updateSettings({
|
|
|
280
|
+ userSelectedCameraDeviceId: deviceId,
|
|
|
281
|
+ userSelectedCameraDeviceLabel: deviceLabel
|
|
|
282
|
+ }));
|
|
|
283
|
+ };
|
|
|
284
|
+}
|
|
|
285
|
+
|
|
247
|
286
|
/**
|
|
248
|
287
|
* Signals to update the list of known audio and video devices.
|
|
249
|
288
|
*
|