I have many audios on every page my app render (in NextJS). I'd like that when an user clicks on an audio button any other audio playing stops (I want to have just one audio playing at the time). How can I achieve this? (I'm using Howler)
My idea was to have a single instance of Howler as singleton it? is it possible to have a single instance of a function and share it across the app? with React Context? (but they're not unique, right?)
2.1m questions
2.1m answers
60 comments
57.0k users