Skip to content

Commit e662a96

Browse files
authored
Emit a final empty AudioVisualizerEvent after track stops (#701)
* Emit a final empty AudioVisualizerEvent after track stops * fmt
1 parent f90275f commit e662a96

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/src/track/local/local.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ mixin AudioTrack on Track {
101101
if (_eventChannel == null) {
102102
return;
103103
}
104+
104105
await Native.stopVisualizer(mediaStreamTrack.id!);
106+
events.emit(AudioVisualizerEvent(
107+
track: this,
108+
event: [],
109+
));
105110
await _streamSubscription?.cancel();
106111
_streamSubscription = null;
107112
_eventChannel = null;

0 commit comments

Comments
 (0)