bugfix
This commit is contained in:
parent
9e611ee75e
commit
ae79a891d7
@ -182,6 +182,7 @@ bricks.RTCP2PConnect = class {
|
||||
*/
|
||||
|
||||
constructor(signaling, session, opts){
|
||||
this.id = bricks.uuid();
|
||||
this.signaling = signaling;
|
||||
this.session = session;
|
||||
this.requester = false;
|
||||
@ -208,8 +209,13 @@ bricks.RTCP2PConnect = class {
|
||||
|
||||
async p2pconnect(peer){
|
||||
await this.getLocalStream();
|
||||
var p = this.peers[peer.id];
|
||||
if (!p){
|
||||
await this.createPeerConnection(peer);
|
||||
console.log('p2pconnect() called, this=', this);
|
||||
} else {
|
||||
aconsole.log(peer, 'connect exists', this);
|
||||
}
|
||||
console.log('p2pconnect() called, this=', this, 'peer=', peer);
|
||||
}
|
||||
async h_sessioncreated(data){
|
||||
if (this.opts.peer_info){
|
||||
@ -238,7 +244,7 @@ bricks.RTCP2PConnect = class {
|
||||
await this.send_offer(data.msgfrom);
|
||||
}
|
||||
async h_offer(data){
|
||||
console.log('send_offer(), peers=', this.peers, 'peer=', data.msgfrom);
|
||||
console.log('h_offer(), this=', this 'peer=', data.msgfrom);
|
||||
var pc = this.peers[data.msgfrom.id].pc;
|
||||
var offer = new RTCSessionDescription(data.offer);
|
||||
await pc.setRemoteDescription(offer);
|
||||
|
Loading…
Reference in New Issue
Block a user