diff --git a/bricks/rtc.js b/bricks/rtc.js index 28312e9..9fe7aad 100644 --- a/bricks/rtc.js +++ b/bricks/rtc.js @@ -322,9 +322,7 @@ bricks.RTCClient = class extends bricks.VBox { this.remoteVideo.set_stream(event.streams[0]); }; - if (this.role == 'requester'){ - await this.send_offer(); - } + await this.send_offer(); console.log('createPeerConnection() finished'); } @@ -332,7 +330,7 @@ bricks.RTCClient = class extends bricks.VBox { console.log(`oniceconnectionstatechange, pc.iceConnectionState is ${this.pc.iceConnectionState}.`); if (this.pc.iceConnectionState === 'disconnected'){ if (this.role == 'requester'){ - await send_offer(); + await this.send_offer(); } } }