leoasis / react-sound

Sound component to play audio in your web apps
ISC License
491 stars 80 forks source link

onPause does not work on iOS when running in background #101

Open paulistoan opened 10 months ago

paulistoan commented 10 months ago

Please see a sample app attached. Basically when playing on iOS, the onPause handler does not seem to get called when running in the background. By running in the background, I mean starting to play, then locking the screen and using the lock screen pause button to pause playback. Interestingly, with the HTML audio element it seems to work. I also included this in the sample app for comparison.

In order to reproduce, please start up the node server in a separate process so that it can receive background events and print them to stdout. Also, please include a real mp3 in the src and url properties in src/App.js.

demo.tar.gz

paulistoan commented 10 months ago

Also found this past bug report, which is now resolved, might be of interest: https://bugs.webkit.org/show_bug.cgi?id=173332