Merge branch 'td/fix_negotiation' into 'main'
fix: correctly pass and wait negotiation callback Closes #323 See merge request famedly/company/frontend/famedlysdk!1104
This commit is contained in:
commit
30060259fe
|
|
@ -402,6 +402,10 @@ class CallSession {
|
||||||
Future<void> initWithInvite(CallType type, RTCSessionDescription offer,
|
Future<void> initWithInvite(CallType type, RTCSessionDescription offer,
|
||||||
SDPStreamMetadata? metadata, int lifetime, bool isGroupCall) async {
|
SDPStreamMetadata? metadata, int lifetime, bool isGroupCall) async {
|
||||||
await _preparePeerConnection();
|
await _preparePeerConnection();
|
||||||
|
if (metadata != null) {
|
||||||
|
_updateRemoteSDPStreamMetadata(metadata);
|
||||||
|
}
|
||||||
|
await pc!.setRemoteDescription(offer);
|
||||||
|
|
||||||
/// only add local stream if it is not a group call.
|
/// only add local stream if it is not a group call.
|
||||||
if (!isGroupCall) {
|
if (!isGroupCall) {
|
||||||
|
|
@ -411,12 +415,6 @@ class CallSession {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (metadata != null) {
|
|
||||||
_updateRemoteSDPStreamMetadata(metadata);
|
|
||||||
}
|
|
||||||
|
|
||||||
await pc!.setRemoteDescription(offer);
|
|
||||||
|
|
||||||
setCallState(CallState.kRinging);
|
setCallState(CallState.kRinging);
|
||||||
|
|
||||||
ringingTimer = Timer(Duration(seconds: 30), () {
|
ringingTimer = Timer(Duration(seconds: 30), () {
|
||||||
|
|
@ -1075,7 +1073,6 @@ class CallSession {
|
||||||
Future<void> _preparePeerConnection() async {
|
Future<void> _preparePeerConnection() async {
|
||||||
try {
|
try {
|
||||||
pc = await _createPeerConnection();
|
pc = await _createPeerConnection();
|
||||||
|
|
||||||
pc!.onRenegotiationNeeded = onNegotiationNeeded;
|
pc!.onRenegotiationNeeded = onNegotiationNeeded;
|
||||||
|
|
||||||
pc!.onIceCandidate = (RTCIceCandidate candidate) async {
|
pc!.onIceCandidate = (RTCIceCandidate candidate) async {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue