mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
make code
This commit is contained in:
@@ -18,15 +18,16 @@ export function set_local_stream(
|
||||
export async function get_video_stream(
|
||||
include_audio: boolean,
|
||||
video_source: HTMLVideoElement,
|
||||
device_id?: string
|
||||
device_id?: string,
|
||||
track_constraints?: MediaTrackConstraints,
|
||||
): Promise<MediaStream> {
|
||||
const size = {
|
||||
const fallback_constraints = track_constraints || {
|
||||
width: { ideal: 500 },
|
||||
height: { ideal: 500 }
|
||||
};
|
||||
|
||||
const constraints = {
|
||||
video: device_id ? { deviceId: { exact: device_id }, ...size } : size,
|
||||
video: device_id ? { deviceId: { exact: device_id }, ...fallback_constraints } : fallback_constraints,
|
||||
audio: include_audio
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user