fix: skip invalid candidate.
This commit is contained in:
parent
c5aa899038
commit
380051ab07
|
|
@ -44,6 +44,15 @@ class Timeouts {
|
||||||
static const delayBeforeOfferMs = 100;
|
static const delayBeforeOfferMs = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension RTCIceCandidateExt on RTCIceCandidate {
|
||||||
|
bool get isValid =>
|
||||||
|
sdpMLineIndex != null &&
|
||||||
|
sdpMid != null &&
|
||||||
|
candidate != null &&
|
||||||
|
sdpMid!.isNotEmpty &&
|
||||||
|
candidate!.isNotEmpty;
|
||||||
|
}
|
||||||
|
|
||||||
/// Wrapped MediaStream, used to adapt Widget to display
|
/// Wrapped MediaStream, used to adapt Widget to display
|
||||||
class WrappedMediaStream {
|
class WrappedMediaStream {
|
||||||
MediaStream? stream;
|
MediaStream? stream;
|
||||||
|
|
@ -716,6 +725,12 @@ class CallSession {
|
||||||
json['sdpMLineIndex']?.round() ?? 0,
|
json['sdpMLineIndex']?.round() ?? 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!candidate.isValid) {
|
||||||
|
Logs().w(
|
||||||
|
'[VOIP] onCandidatesReceived => skip invalid candidate $candidate');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (direction == CallDirection.kOutgoing &&
|
if (direction == CallDirection.kOutgoing &&
|
||||||
pc != null &&
|
pc != null &&
|
||||||
await pc!.getRemoteDescription() == null) {
|
await pc!.getRemoteDescription() == null) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue