Merge branch 'td/forcePcDispose' into 'main'
chore: stopMediaStream on all streams and make sure dispose runs everytime See merge request famedly/company/frontend/famedlysdk!1264
This commit is contained in:
commit
1a96683226
|
|
@ -102,15 +102,15 @@ class WrappedMediaStream {
|
||||||
|
|
||||||
Future<void> dispose() async {
|
Future<void> dispose() async {
|
||||||
renderer.srcObject = null;
|
renderer.srcObject = null;
|
||||||
if (isLocal()) {
|
|
||||||
if (isWeb) {
|
/// libwebrtc does not provide a way to clone MediaStreams. So stopping the
|
||||||
await stopMediaStream(stream);
|
/// local stream here would break calls with all other participants if anyone
|
||||||
} else {
|
/// leaves. The local stream is manually disposed when user leaves. On web
|
||||||
if (!isGroupCall) {
|
/// streams are actually cloned.
|
||||||
await stopMediaStream(stream);
|
if (!isGroupCall || isWeb) {
|
||||||
}
|
await stopMediaStream(stream);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stream = null;
|
stream = null;
|
||||||
await renderer.dispose();
|
await renderer.dispose();
|
||||||
}
|
}
|
||||||
|
|
@ -1386,12 +1386,17 @@ class CallSession {
|
||||||
await stream.dispose();
|
await stream.dispose();
|
||||||
}
|
}
|
||||||
streams.clear();
|
streams.clear();
|
||||||
|
} catch (e) {
|
||||||
|
Logs().e('[VOIP] cleaning up streams failed', e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
if (pc != null) {
|
if (pc != null) {
|
||||||
await pc!.close();
|
await pc!.close();
|
||||||
await pc!.dispose();
|
await pc!.dispose();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Logs().e('cleaning up streams failed', e);
|
Logs().e('[VOIP] removing pc failed', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue