This commit is contained in:
yumoqing 2024-10-11 15:21:55 +08:00
parent 98eef3e239
commit 1bd3db21d3

View File

@ -325,6 +325,7 @@ bricks.RTCP2PConnect = class {
async connection_statechange(peer, event){
var pc = this.peers[peer.id].pc;
console.log(`${peer.id} state changed. new state=${pc.connectionState}`);
if (pc.connectionState == 'disconnected'){
var w = new bricks.Error({
title:'Error',
@ -341,7 +342,6 @@ bricks.RTCP2PConnect = class {
await this.createDataChannel(peer);
}
}
console.log(`${peer.id} connect losed. ${pc.connectionState}`);
}
}
@ -376,6 +376,7 @@ bricks.RTCP2PConnect = class {
const configuration = {
iceServers:this.opts.ice_servers
}
console.log('RTCPC configuration=', configuration);
var pc = new RTCPeerConnection(configuration);
if (this.local_stream){
this.local_stream.getTracks()