This commit is contained in:
yumoqing 2024-08-24 19:34:59 +08:00
parent e7f63b40c3
commit a490821cdd

View File

@ -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) {