connectivity handling, audio publishing
This commit is contained in:
+12
-2
@@ -11,16 +11,26 @@ class PCTransport {
|
||||
Future<void> setRemoteDescription(RTCSessionDescription sd) async {
|
||||
await pc.setRemoteDescription(sd);
|
||||
|
||||
Future.forEach<RTCIceCandidate>(pendingCandidates, (candidate) async {
|
||||
await Future.forEach<RTCIceCandidate>(pendingCandidates, (candidate) async {
|
||||
await pc.addCandidate(candidate);
|
||||
});
|
||||
|
||||
pendingCandidates.clear();
|
||||
restartingIce = false;
|
||||
}
|
||||
|
||||
Future<void> addIceCandidate(RTCIceCandidate candidate) async {
|
||||
var desc = await pc.getRemoteDescription();
|
||||
var desc = await getRemoteDescription();
|
||||
if (desc != null && !restartingIce) {
|
||||
return pc.addCandidate(candidate);
|
||||
}
|
||||
pendingCandidates.add(candidate);
|
||||
}
|
||||
|
||||
Future<RTCSessionDescription?> getRemoteDescription() async {
|
||||
if (pc.iceConnectionState == null) {
|
||||
return null;
|
||||
}
|
||||
return pc.getRemoteDescription();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user