useAudioPlayer icon indicating copy to clipboard operation
useAudioPlayer copied to clipboard

Changing track resets the volume

Open ranile opened this issue 1 year ago • 1 comments

Describe the bug Loading a track resets the volume set previously

This is almost certainly due to howl instance being recreated on load: https://github.com/E-Kuerschner/useAudioPlayer/blob/5268fc0113d6930888f7adae7c10f5d4091faf8a/src/useGlobalAudioPlayer.ts#L44-L50

https://github.com/E-Kuerschner/useAudioPlayer/blob/5268fc0113d6930888f7adae7c10f5d4091faf8a/src/HowlInstanceManager.ts#L32-L33

Reusing the same howl instance, or at least copying over the settings from current one over should resolve this

To Reproduce With global audio player

  1. load a track
  2. setVolume (anything other than 100%)
  3. load another track
  4. Volume is back to 100%

Expected behavior Volume should stay

Environment (please complete the following information):

  • Browser/ browser version: Firefox 132.0.2
  • Library version: 2.2.0
  • React version: 18.2.0
  • Node version: 18

ranile avatar Nov 22 '24 16:11 ranile

Hi @ranile, thank you for the issue. I have some time coming up dedicated to this project so I will see about getting this in. Planning for some maintenance work on the repo as well as some bug fixes.

E-Kuerschner avatar Dec 20 '24 16:12 E-Kuerschner