chore: Correctly release the cloned stream.
This commit is contained in:
parent
651abc7c14
commit
8b60f17356
|
|
@ -82,12 +82,10 @@ class WrappedMediaStream {
|
||||||
|
|
||||||
Future<void> dispose() async {
|
Future<void> dispose() async {
|
||||||
renderer.srcObject = null;
|
renderer.srcObject = null;
|
||||||
if (isLocal() && !isGroupCall && stream != null) {
|
if (isLocal() && stream != null) {
|
||||||
if (isWeb) {
|
|
||||||
for (final element in stream!.getTracks()) {
|
for (final element in stream!.getTracks()) {
|
||||||
await element.stop();
|
await element.stop();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
await stream?.dispose();
|
await stream?.dispose();
|
||||||
stream = null;
|
stream = null;
|
||||||
}
|
}
|
||||||
|
|
@ -737,7 +735,9 @@ class CallSession {
|
||||||
|
|
||||||
if (purpose == SDPStreamMetadataPurpose.Usermedia) {
|
if (purpose == SDPStreamMetadataPurpose.Usermedia) {
|
||||||
speakerOn = type == CallType.kVideo;
|
speakerOn = type == CallType.kVideo;
|
||||||
if (!voip.delegate.isWeb && !voip.delegate.isBackgroud) {
|
if (!voip.delegate.isWeb &&
|
||||||
|
!voip.delegate.isBackgroud &&
|
||||||
|
stream.getAudioTracks().isNotEmpty) {
|
||||||
final audioTrack = stream.getAudioTracks()[0];
|
final audioTrack = stream.getAudioTracks()[0];
|
||||||
audioTrack.enableSpeakerphone(speakerOn);
|
audioTrack.enableSpeakerphone(speakerOn);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue