From 3af4d43157b6321157296f2e1789d278e6043ad3 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 23 Aug 2024 11:35:22 +0800 Subject: [PATCH] bugfix --- bricks/rtc.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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(); } } }