E-Kuerschner / useAudioPlayer

React hooks for controlling audio on the web
MIT License
315 stars 35 forks source link

Audio playback stops when safari unfocused on ios #138

Open Codigo-Fuentes opened 4 months ago

Codigo-Fuentes commented 4 months ago

Describe the bug Audio playback stops when safari unfocused on ios. If i use a regular

To Reproduce Steps to reproduce the behavior:

  1. load a song
  2. play it
  3. unfocus safari

Expected behavior Audio keeps playing on unfocus.

Environment (please complete the following information):

E-Kuerschner commented 4 months ago

Hi @Codigo-Fuentes thanks for opening the issue. I don't think I'll be able to get around to triaging this any time soon (feel free to take a look and open a PR if you want to take a stab at it!), but can I ask how you are loading the sound? I think you may need to load with the html5 option set to true. The media session API only works with HTML5 elements, not the Web Audio API which Howler uses by default.