chore: add noice/echo cancelling flags to getUserMedia
This commit is contained in:
parent
0fedbc3307
commit
1e90fcee93
|
|
@ -44,6 +44,21 @@ class CallTimeouts {
|
||||||
static const delayBeforeOffer = Duration(milliseconds: 100);
|
static const delayBeforeOffer = Duration(milliseconds: 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class UserMediaOptions {
|
||||||
|
static const optionalAudioConfig = {
|
||||||
|
'echoCancellation': true,
|
||||||
|
'googDAEchoCancellation': true,
|
||||||
|
'googEchoCancellation': true,
|
||||||
|
'googEchoCancellation2': true,
|
||||||
|
'noiseSuppression': true,
|
||||||
|
'googNoiseSuppression': true,
|
||||||
|
'googNoiseSuppression2': true,
|
||||||
|
'googAutoGainControl': true,
|
||||||
|
'googHighpassFilter': true,
|
||||||
|
'googTypingNoiseDetection': true,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
extension RTCIceCandidateExt on RTCIceCandidate {
|
extension RTCIceCandidateExt on RTCIceCandidate {
|
||||||
bool get isValid =>
|
bool get isValid =>
|
||||||
sdpMLineIndex != null &&
|
sdpMLineIndex != null &&
|
||||||
|
|
@ -1481,7 +1496,7 @@ class CallSession {
|
||||||
'minFrameRate': '30',
|
'minFrameRate': '30',
|
||||||
},
|
},
|
||||||
'facingMode': 'user',
|
'facingMode': 'user',
|
||||||
'optional': [],
|
'optional': [UserMediaOptions.optionalAudioConfig],
|
||||||
}
|
}
|
||||||
: false,
|
: false,
|
||||||
};
|
};
|
||||||
|
|
@ -1566,7 +1581,7 @@ class CallSession {
|
||||||
Map<String, dynamic> _getOfferAnswerConstraints({bool iceRestart = false}) {
|
Map<String, dynamic> _getOfferAnswerConstraints({bool iceRestart = false}) {
|
||||||
return {
|
return {
|
||||||
'mandatory': {if (iceRestart) 'IceRestart': true},
|
'mandatory': {if (iceRestart) 'IceRestart': true},
|
||||||
'optional': [],
|
'optional': [UserMediaOptions.optionalAudioConfig],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -324,7 +324,7 @@ class GroupCall {
|
||||||
'minFrameRate': '30',
|
'minFrameRate': '30',
|
||||||
},
|
},
|
||||||
'facingMode': 'user',
|
'facingMode': 'user',
|
||||||
'optional': [],
|
'optional': [UserMediaOptions.optionalAudioConfig],
|
||||||
}
|
}
|
||||||
: false,
|
: false,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue