Add onIceCandidateError handler for video calls.

This commit is contained in:
aforge
2022-07-26 01:07:26 +03:00
parent 69282bab89
commit 9cd778534a
+7
View File
@@ -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());