From a490821cdd258ac7cb8c14cec56b714a2a32a1a1 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 24 Aug 2024 19:34:59 +0800 Subject: [PATCH] bugfix --- bricks/rtc.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bricks/rtc.js b/bricks/rtc.js index 7f50925..8098bb9 100644 --- a/bricks/rtc.js +++ b/bricks/rtc.js @@ -20,6 +20,10 @@ bricks.RTCClient = class extends bricks.VBox { { "signaling_url": "ice_url": + "mediaOptions":{ + "audio":true, + "video":true + } "auto_call_accept":false "info":{ "id": @@ -147,7 +151,11 @@ bricks.RTCClient = class extends bricks.VBox { // 获取本地媒体流 async getLocalStream() { try { - const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true }); + var videoOptions = this.mediaOptions || { + video: true, + audio: true + }; + const stream = await navigator.mediaDevices.getUserMedia(mediaOptions); this.localVideo.set_stream(stream); return stream; } catch (error) {