Comments (2)
@AlesSrsen interesting use case, but this makes sense to me. It sounds almost like a good case for useGlobalAudioPlayer but as you mentioned this only supports one sound. Perhaps we could update the API to allow for multiple global sounds to be created/started? What do you think?
Also, I won't have as much bandwidth as I had earlier this year. If this is something you're open to collabing on in the form of a PR, feel free to get started on one or starting a back and forth here where we can at least discuss the solution options.
from useaudioplayer.
@E-Kuerschner I actualy did something different in the end. It is not the best practice but I created a new Audio object in the global scope, that I control with a custom hook.
But your idea of adding the ability to load more global sounds pretty smart. I might look into your source and come up with a PR if I have some free time.
The sounds will have to be probably keyed in some way as to be able to choose which one should the hook return.
But back to the initial idea, don't you think, that this could be added by checking whether the sound is playing during unmount and adding an event listener on ended
to destory the howl? Or are you against this kind of rule bending?
from useaudioplayer.
Related Issues (20)
- usePosition doesnt work anymore HOT 3
- starting with empty src loads infinitely HOT 2
- Download audio HOT 1
- Support SSR HOT 6
- `AudioLoadOptions` shape does not correspond Howler constructor options and missing some of them HOT 9
- isLoading boolean HOT 4
- HTML5 Audio pool exhausted, returning potentially locked audio object. Is this because of this library or not? HOT 1
- Adding `player` back — Howler Instance Reference HOT 4
- Error in the Readme, fade arg says second not ms HOT 2
- Inconsistencies on lock screen controls when playing in background on iOS HOT 2
- Audio not changing when recording is different but link is same HOT 4
- useGlobalAudioPlayer and useAudioPlayer seems to mix up their states HOT 4
- How to adjust the audio playback progress ? HOT 1
- Upgrade Howler
- Refactor state management to decouple from Howler
- Refactor to use React.useSyncExternalStore
- playback speed sounds like a chipmunk HOT 1
- Audio playback stops when safari unfocused on ios HOT 1
- Host package on JSR
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from useaudioplayer.