@whereby.com/media 9.2.2 → 9.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -2
- package/dist/index.mjs +4 -2
- package/dist/legacy-esm.js +4 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2473,9 +2473,11 @@ function getMediaConstraints({ disableAEC, disableAGC, hd, lax, lowDataMode, pre
|
|
|
2473
2473
|
function getConstraints({ devices, videoId, audioId, options, type = "ideal" }) {
|
|
2474
2474
|
const audioDevices = devices.filter((d) => d.kind === "audioinput");
|
|
2475
2475
|
const videoDevices = devices.filter((d) => d.kind === "videoinput");
|
|
2476
|
+
const useDefaultAudio = !audioId || !audioDevices.some((d) => d.deviceId === audioId);
|
|
2477
|
+
const useDefaultVideo = !videoId || !videoDevices.some((d) => d.deviceId === videoId);
|
|
2476
2478
|
const constraints = getMediaConstraints(Object.assign({ preferredDeviceIds: {
|
|
2477
|
-
audioId:
|
|
2478
|
-
videoId:
|
|
2479
|
+
audioId: useDefaultAudio ? null : { [type]: audioId },
|
|
2480
|
+
videoId: useDefaultVideo ? null : { [type]: videoId },
|
|
2479
2481
|
} }, options));
|
|
2480
2482
|
if (audioId === false || !audioDevices.length) {
|
|
2481
2483
|
delete constraints.audio;
|
package/dist/index.mjs
CHANGED
|
@@ -2452,9 +2452,11 @@ function getMediaConstraints({ disableAEC, disableAGC, hd, lax, lowDataMode, pre
|
|
|
2452
2452
|
function getConstraints({ devices, videoId, audioId, options, type = "ideal" }) {
|
|
2453
2453
|
const audioDevices = devices.filter((d) => d.kind === "audioinput");
|
|
2454
2454
|
const videoDevices = devices.filter((d) => d.kind === "videoinput");
|
|
2455
|
+
const useDefaultAudio = !audioId || !audioDevices.some((d) => d.deviceId === audioId);
|
|
2456
|
+
const useDefaultVideo = !videoId || !videoDevices.some((d) => d.deviceId === videoId);
|
|
2455
2457
|
const constraints = getMediaConstraints(Object.assign({ preferredDeviceIds: {
|
|
2456
|
-
audioId:
|
|
2457
|
-
videoId:
|
|
2458
|
+
audioId: useDefaultAudio ? null : { [type]: audioId },
|
|
2459
|
+
videoId: useDefaultVideo ? null : { [type]: videoId },
|
|
2458
2460
|
} }, options));
|
|
2459
2461
|
if (audioId === false || !audioDevices.length) {
|
|
2460
2462
|
delete constraints.audio;
|
package/dist/legacy-esm.js
CHANGED
|
@@ -2452,9 +2452,11 @@ function getMediaConstraints({ disableAEC, disableAGC, hd, lax, lowDataMode, pre
|
|
|
2452
2452
|
function getConstraints({ devices, videoId, audioId, options, type = "ideal" }) {
|
|
2453
2453
|
const audioDevices = devices.filter((d) => d.kind === "audioinput");
|
|
2454
2454
|
const videoDevices = devices.filter((d) => d.kind === "videoinput");
|
|
2455
|
+
const useDefaultAudio = !audioId || !audioDevices.some((d) => d.deviceId === audioId);
|
|
2456
|
+
const useDefaultVideo = !videoId || !videoDevices.some((d) => d.deviceId === videoId);
|
|
2455
2457
|
const constraints = getMediaConstraints(Object.assign({ preferredDeviceIds: {
|
|
2456
|
-
audioId:
|
|
2457
|
-
videoId:
|
|
2458
|
+
audioId: useDefaultAudio ? null : { [type]: audioId },
|
|
2459
|
+
videoId: useDefaultVideo ? null : { [type]: videoId },
|
|
2458
2460
|
} }, options));
|
|
2459
2461
|
if (audioId === false || !audioDevices.length) {
|
|
2460
2462
|
delete constraints.audio;
|