mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
Update index.svelte
This commit is contained in:
@@ -150,6 +150,16 @@
|
|||||||
micMuted = false;
|
micMuted = false;
|
||||||
cameraOff = false;
|
cameraOff = false;
|
||||||
volumeMuted = false;
|
volumeMuted = false;
|
||||||
|
await navigator.mediaDevices
|
||||||
|
.getUserMedia({
|
||||||
|
audio: true,
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
await navigator.mediaDevices
|
||||||
|
.getUserMedia({
|
||||||
|
video: true,
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
const devices = await get_devices();
|
const devices = await get_devices();
|
||||||
available_video_devices = set_available_devices(devices, "videoinput");
|
available_video_devices = set_available_devices(devices, "videoinput");
|
||||||
available_audio_devices = set_available_devices(devices, "audioinput");
|
available_audio_devices = set_available_devices(devices, "audioinput");
|
||||||
@@ -157,8 +167,8 @@
|
|||||||
console.log(available_audio_devices);
|
console.log(available_audio_devices);
|
||||||
|
|
||||||
await get_stream(
|
await get_stream(
|
||||||
devices.some((device) => device.kind === "audioinput"),
|
devices.some((device) => device.kind === "audioinput" && device.deviceId),
|
||||||
devices.some((device) => device.kind === "videoinput"),
|
devices.some((device) => device.kind === "videoinput" && device.deviceId),
|
||||||
node,
|
node,
|
||||||
track_constraints,
|
track_constraints,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user