useAudioPlayer icon indicating copy to clipboard operation
useAudioPlayer copied to clipboard

Allow player to control arbitrary audio out

Open sammbeller opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. I would like to use useAudioPlayer to fulfill the requirements for this issue but we need to be able to control a remote "jukebox" - the audio out of the computer the server is running on.

Describe the solution you'd like I'd like useAudioPlayer to take an optional AudioOutProvider which implements against a defined API the required calls to support useAuditoPlayer's API. For a remote server this would involve calling out to the server to control playback of the audio. I would be happy to help contribute to this solution or implement it myself, but I wanted to open this issue to start the conversation and determine if you're open to these changes.

sammbeller avatar Sep 15 '24 18:09 sammbeller

Just to add to what @sammbeller said, ideally we would specify the AudioOutProvider using a React Context.Provider (https://react.dev/reference/react/useContext)

In this scenario, the current Howl-based audio out would be the default provider, if none is set in the context.

deluan avatar Sep 15 '24 18:09 deluan

If it helps you guys out, 4.0.0 was just published, in which you can access the underlying Howl object as an escape hatch. Beyond that, the aim of this project is really to only sync state from Howler in a React way. You might need to open up a feature request with them since Howler is audio driver here.

E-Kuerschner avatar Feb 25 '25 17:02 E-Kuerschner

@E-Kuerschner Thank you for your response. @deluan for visibility. I think this means we'll need our own implementation.

sammbeller avatar Feb 25 '25 17:02 sammbeller