This commit is contained in:
yumoqing 2024-10-11 17:31:20 +08:00
parent 520e2ad10c
commit d45f625a7d

View File

@ -361,21 +361,21 @@ bricks.RTCP2PConnect = class {
} }
async datachannel_message(peer, msg){ async datachannel_message(peer, msg){
console.log('datachannel_message():', this, peer, msg); console.log('datachannel_message():', this, arguments);
var dc = this.peers[peer.id].dc; var dc = this.peers[peer.id].dc;
if (this.opts.on_dc_messaage){ if (this.opts.on_dc_messaage){
await this.opts.on_dc_message(dc, msg); await this.opts.on_dc_message(dc, msg);
} }
} }
async datachannel_open(peer){ async datachannel_open(peer){
console.log('datachannel_open():', this, peer); console.log('datachannel_open():', this, arguments);
var dc = this.peers[peer.id].dc var dc = this.peers[peer.id].dc
if (this.opts.on_dc_open){ if (this.opts.on_dc_open){
await this.opts.on_dc_open(dc); await this.opts.on_dc_open(dc);
} }
} }
async datachannel_close(peer){ async datachannel_close(peer){
console.log('datachannel_close():', this, peer); console.log('datachannel_close():', this, arguments);
var dc = this.peers[peer.id].dc var dc = this.peers[peer.id].dc
if (this.opts.on_dc_close){ if (this.opts.on_dc_close){
await this.opts.on_dc_close(dc); await this.opts.on_dc_close(dc);