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}.`);