Skip to content

Commit

Permalink
Fix side effects for stop remote track. (#675)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc authored Dec 31, 2024
1 parent eae996a commit 5e50d09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/track/remote/remote.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ abstract class RemoteTrack extends Track {

@override
Future<bool> stop() async {
final didStop = await super.stop() || !muted;
if (didStop) {
final didStop = await super.stop();
if (didStop || !muted) {
await disable();
}
return didStop;
Expand Down
1 change: 1 addition & 0 deletions lib/src/track/track.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ abstract class Track extends DisposableChangeNotifier
try {
if (_active || !_muted) {
mediaStreamTrack.enabled = false;
if (!_muted) _muted = true;
}
} catch (_) {
logger.warning(
Expand Down

0 comments on commit 5e50d09

Please sign in to comment.