I have multiple waveforms, how do I stop a playing waveform if I play another one? #3840
Unanswered
IlyasKeskinn
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm building a live chat application where users can send and receive voice messages. Each voice message is visualized using WaveSurfer.js. My issue is that when a user plays a voice message, it works fine, but I want to make sure that only one message plays at a time. If one voice message is already playing and the user starts playing another one, the previous message should automatically stop.
Here's the my code:
I've tried a few things like using refs and state to keep track of the playing instance, but I can't seem to get the behavior right where the previous message stops when a new one is played. Could anyone guide me on how to implement this?
Beta Was this translation helpful? Give feedback.
All reactions