Version 2.0 Incoming! 🎉 #106
Replies: 2 comments 9 replies
-
looking forward espl being able to play multiple audio sources, i have a feature request
|
Beta Was this translation helpful? Give feedback.
-
Great to see that you pick upt this project and take it further! Interesting to read about your ideas. I'm curious to see how it will fit my use case. Not sure if you intend to support multiple simultaneously playing audio sources, or multiple to switch between. I guess both concepts can be relevant for different apps. Multiple tracks playing at the same time would certainly confuse my users :) I definitely need to keep track(!) of the position, so I will have to find a way for that. Maybe it can be done with a simple |
Beta Was this translation helpful? Give feedback.
-
Update => v2.0.0-alpha.0 ready to test! (#108)
👋 Greetings useAudioPlayer users!!
I just wanted to get notice out that I'm working on a full rewrite of the package which I expect to drop some time in May. Below are a few things of note about the new version. Please leave any comments/concern/feedback in the thread. Cheers!
useAudioPlayer -> useGlobalAudioPlayer
The original use case I set out to satisfy with this package was a singular audio source which could be controlled from anywhere in your app/component tree. This was inspired by applications like Spotify or SoundCloud. Because of the frequent requests to support multiple audio sources from the community, I will be renaming the main hook to better convey what it does, which is controlling a global audio source for the whole app.
no more AudioPlayerContext
One of the major complaints I had with the original implementation was the need to wrap the portion of the app which controls audio in a Provider. This was a constant source of bugs and did not feel intuitive to write. You will be happy to hear that
useGlobalAudioPlayer
will be supported without the need for a Provider wrapping its usages 🎉multiple audio sources
The name of the original hook,
useAudioPlayer
will now be used for a new hook. A component can instantiate multiple instances of this hook to simultaneously control different audio sources.no more useAudioPosition
This one may come as a surprise to some, and I apologize, but it does feel like the responsibility of this package to provide a solution to animation (animating a seek bar/time code), this can easily be achieved in the client application without too much extra effort. I still believe that a constant state update for every change in audio progress is to heavy to include in the main hook (this is why useAudioPosition was created originally), so there will only be a getter function provided on the API,
getPosition
.Beta Was this translation helpful? Give feedback.
All reactions