From 9cd778534a5f18e55ec001b9f64fb7611fe1933a Mon Sep 17 00:00:00 2001 From: aforge Date: Tue, 26 Jul 2022 01:07:26 +0300 Subject: [PATCH] Add onIceCandidateError handler for video calls. --- src/widgets/call-panel.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/widgets/call-panel.jsx b/src/widgets/call-panel.jsx index 6bc271c1..3d405ee1 100644 --- a/src/widgets/call-panel.jsx +++ b/src/widgets/call-panel.jsx @@ -62,6 +62,7 @@ class CallPanel extends React.PureComponent { this.handleICEConnectionStateChangeEvent = this.handleICEConnectionStateChangeEvent.bind(this); this.handleSignalingStateChangeEvent = this.handleSignalingStateChangeEvent.bind(this); this.handleICEGatheringStateChangeEvent = this.handleICEGatheringStateChangeEvent.bind(this); + this.handleIceCandidateErrorEvent = this.handleIceCandidateErrorEvent.bind(this); this.handleTrackEvent = this.handleTrackEvent.bind(this); this.handleVideoOfferMsg = this.handleVideoOfferMsg.bind(this); @@ -181,6 +182,7 @@ class CallPanel extends React.PureComponent { this.state.pc.onsignalingstatechange = null; this.state.pc.onicegatheringstatechange = null; this.state.pc.onnegotiationneeded = null; + this.state.pc.onicecandidateerror = null; this.state.pc.close(); } @@ -216,6 +218,7 @@ class CallPanel extends React.PureComponent { pc.onicegatheringstatechange = this.handleICEGatheringStateChangeEvent; pc.onsignalingstatechange = this.handleSignalingStateChangeEvent; pc.onnegotiationneeded = this.handleNegotiationNeededEvent; + pc.onicecandidateerror = this.handleIceCandidateErrorEvent; pc.ontrack = this.handleTrackEvent; this.setState({pc: pc, waitingForPeer: false}); @@ -254,6 +257,10 @@ class CallPanel extends React.PureComponent { .catch(this.reportError); } + handleIceCandidateErrorEvent(event) { + console.log('ICE candidate error: ', event); + } + handleICECandidateEvent(event) { if (event.candidate) { this.props.onIceCandidate(this.props.topic, this.props.seq, event.candidate.toJSON());