Skip to content

Commit

Permalink
Emit a final empty AudioVisualizerEvent after track stops
Browse files Browse the repository at this point in the history
  • Loading branch information
bcherry committed Feb 5, 2025
1 parent f90275f commit bc5b537
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/src/track/local/local.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ mixin AudioTrack on Track {
if (_eventChannel == null) {
return;
}

await Native.stopVisualizer(mediaStreamTrack.id!);
events.emit(AudioVisualizerEvent(
track: this,
event: [],
));
await _streamSubscription?.cancel();
_streamSubscription = null;
_eventChannel = null;
Expand Down

0 comments on commit bc5b537

Please sign in to comment.