This commit is contained in:
yumoqing 2024-10-11 13:00:05 +08:00
parent 1761a48851
commit 8e02a13d9a

View File

@ -364,7 +364,7 @@ bricks.RTCP2PConnect = class {
} }
this.peers[peer.id] = peer; this.peers[peer.id] = peer;
this.peers[peer.id][pc] = pc; this.peers[peer.id][pc] = pc;
var remoteVideo = new VideoBox(); var remoteVideo = new bricks.VideoBox();
this.peers[peer.id][video] = remoteVideo; this.peers[peer.id][video] = remoteVideo;
pc.onicecandidate = this.send_candidate.bind(this, peer); pc.onicecandidate = this.send_candidate.bind(this, peer);
pc.oniceconnectionstatechange = this.ice_statechange.bind(this, peer); pc.oniceconnectionstatechange = this.ice_statechange.bind(this, peer);
@ -385,7 +385,7 @@ bricks.RTCP2PConnect = class {
try { try {
var mediaOptions = this.opts.media_options; var mediaOptions = this.opts.media_options;
this.local_stream = await navigator.mediaDevices.getUserMedia(mediaOptions); this.local_stream = await navigator.mediaDevices.getUserMedia(mediaOptions);
this.localVideo = new VideoBox(); this.localVideo = new bricks.VideoBox();
this.localVideo.set_stream(local_stream); this.localVideo.set_stream(local_stream);
} catch (error) { } catch (error) {
console.error('获取本地媒体流失败:', error); console.error('获取本地媒体流失败:', error);