From dc3b05e33dd95af05ea7453df6e9d9cbc139ef5a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 22 Aug 2024 14:38:18 +0800 Subject: [PATCH] bugfix --- bricks/rtc.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bricks/rtc.js b/bricks/rtc.js index adafa72..b093ca0 100644 --- a/bricks/rtc.js +++ b/bricks/rtc.js @@ -316,8 +316,13 @@ bricks.RTCClient = class extends bricks.VBox { console.log('createPeerConnection() finished'); } - ice_statechange(event){ + async ice_statechange(event){ console.log(`oniceconnectionstatechange, pc.iceConnectionState is ${this.pc.iceConnectionState}.`) + if (this.pc.iceConnectionState == 'disconnected'){ + if (this.role == 'requester'){ + send_offer(); + } + } } ice_g_statechange(event){ console.log(`onicegatheringstatechange, pc.iceGatheringState is ${this.pc.iceGatheringState}.`);