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 {
|
Future<void> cleanUp() async {
|
||||||
for (final stream in streams) {
|
try {
|
||||||
await stream.dispose();
|
for (final stream in streams) {
|
||||||
}
|
await stream.dispose();
|
||||||
streams.clear();
|
}
|
||||||
if (pc != null) {
|
streams.clear();
|
||||||
await pc!.close();
|
if (pc != null) {
|
||||||
await pc!.dispose();
|
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 =
|
final CachedStreamController<GroupCall> onGroupCallFeedsChanged =
|
||||||
CachedStreamController();
|
CachedStreamController();
|
||||||
|
|
||||||
final CachedStreamController<GroupCallState> onGroupCallState =
|
final CachedStreamController<String> onGroupCallState =
|
||||||
CachedStreamController();
|
CachedStreamController();
|
||||||
|
|
||||||
final CachedStreamController<String> onGroupCallEvent =
|
final CachedStreamController<String> onGroupCallEvent =
|
||||||
|
|
@ -294,6 +294,7 @@ class GroupCall {
|
||||||
|
|
||||||
void setState(String newState) {
|
void setState(String newState) {
|
||||||
state = newState;
|
state = newState;
|
||||||
|
onGroupCallState.add(newState);
|
||||||
onGroupCallEvent.add(GroupCallEvent.GroupCallStateChanged);
|
onGroupCallEvent.add(GroupCallEvent.GroupCallStateChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue