From 2afc9963969ccd8465cf583279015ceb01e87fec Mon Sep 17 00:00:00 2001 From: CloudWebRTC Date: Mon, 23 Dec 2024 22:40:39 +0800 Subject: [PATCH] fix track.stop for remote track. (#669) --- lib/src/track/remote/remote.dart | 2 +- lib/src/track/track.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/track/remote/remote.dart b/lib/src/track/remote/remote.dart index 03a4e45bb..8db2d09ee 100644 --- a/lib/src/track/remote/remote.dart +++ b/lib/src/track/remote/remote.dart @@ -43,7 +43,7 @@ abstract class RemoteTrack extends Track { @override Future stop() async { - final didStop = await super.stop(); + final didStop = await super.stop() || !muted; if (didStop) { await disable(); } diff --git a/lib/src/track/track.dart b/lib/src/track/track.dart index cbddaabc0..d03f9276c 100644 --- a/lib/src/track/track.dart +++ b/lib/src/track/track.dart @@ -153,7 +153,7 @@ abstract class Track extends DisposableChangeNotifier logger .fine('$objectId.disable() disabling ${mediaStreamTrack.objectId}...'); try { - if (_active) { + if (_active || !_muted) { mediaStreamTrack.enabled = false; } } catch (_) {