fix: update groupCalls state stream
refactor: add a try catch around disposing streams. Decoding streams is broken in flutter_webrtc atm
This commit is contained in:
parent
e81fce1f1f
commit
5510049dec
|
|
@ -1201,13 +1201,17 @@ class CallSession {
|
|||
}
|
||||
|
||||
Future<void> cleanUp() async {
|
||||
for (final stream in streams) {
|
||||
await stream.dispose();
|
||||
}
|
||||
streams.clear();
|
||||
if (pc != null) {
|
||||
await pc!.close();
|
||||
await pc!.dispose();
|
||||
try {
|
||||
for (final stream in streams) {
|
||||
await stream.dispose();
|
||||
}
|
||||
streams.clear();
|
||||
if (pc != null) {
|
||||
await pc!.close();
|
||||
await pc!.dispose();
|
||||
}
|
||||
} catch (e) {
|
||||
Logs().e('cleaning up streams failed', e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ class GroupCall {
|
|||
final CachedStreamController<GroupCall> onGroupCallFeedsChanged =
|
||||
CachedStreamController();
|
||||
|
||||
final CachedStreamController<GroupCallState> onGroupCallState =
|
||||
final CachedStreamController<String> onGroupCallState =
|
||||
CachedStreamController();
|
||||
|
||||
final CachedStreamController<String> onGroupCallEvent =
|
||||
|
|
@ -294,6 +294,7 @@ class GroupCall {
|
|||
|
||||
void setState(String newState) {
|
||||
state = newState;
|
||||
onGroupCallState.add(newState);
|
||||
onGroupCallEvent.add(GroupCallEvent.GroupCallStateChanged);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue