This commit is contained in:
yumoqing 2024-08-28 11:09:14 +08:00
parent a490821cdd
commit 837920d986

View File

@ -59,6 +59,20 @@ bricks.RTCClient = class extends bricks.VBox {
} }
} }
async function captureScreen() {
let mediaStream = null;
try {
mediaStream = await navigator.mediaDevices.getDisplayMedia({
video: {
cursor: "always"
},
audio: false
});
return mediaStream;
} catch (ex) {
console.log("Error occurred", ex);
}
}
init_websocket(){ init_websocket(){
this.socket = new WebSocket(this.signaling_url); this.socket = new WebSocket(this.signaling_url);
this.socket.onmessage = this.signaling_message_handle.bind(this); this.socket.onmessage = this.signaling_message_handle.bind(this);
@ -151,7 +165,7 @@ bricks.RTCClient = class extends bricks.VBox {
// 获取本地媒体流 // 获取本地媒体流
async getLocalStream() { async getLocalStream() {
try { try {
var videoOptions = this.mediaOptions || { var mediaOptions = this.mediaOptions || {
video: true, video: true,
audio: true audio: true
}; };