Closed coretekk closed 4 years ago
If anyone else encounters this, here is more information: https://debuggerdotbreak.judahgabriel.com/2016/12/13/its-almost-2017-and-html5-audio-is-still-broken-on-ios/
I tried the demo Music Player on this page https://howlerjs.com/ on an iPad Pro and it would not advance the playlist after the first track on the lock screen :(
This is due to the Auto-play policy on iOS Safari. In Playlist another audio won't start automatically because it requires a user interaction.
I overcame this issue by playing a silent audio on loop with html5: true flag. This will keep the context alive for audios. Then you can play rest of the files in sequence with html5: false flag.
@aareeph could you possibly elaborate on your playing silent audio loop? Does this work on iOS and android?
I've tried what you suggested but it's had no effect. Example code would be really appreciated!
Hi @rlyttle, actually the silent audio loop trick didn't work for me very well for iOS. Although I was able to play next audio without user interaction, this wasn't working fine when the app is in background or device is locked.
For Android everything worked fine and we don't need to do the silent audio loop trick at all.
Please have a look at these release notes. Author has updated the library to play next audios in a pool without any user interaction. So I believe that you don't need any workaround for now. https://github.com/goldfire/howler.js/blob/master/CHANGELOG.md#210-december-12-2018
@aareeph Thanks for the detailed response! I'll do some investigation!
Closing due to inactivity. If this is still an issue, reply with more info and I'll reopen.
On my android device audio plays when the screen is locked.
Now I got a report that the audio stops playing when the screen is locked on iOS. Unfortunately I can't test it because I don't have an iOS device. Anyone knows if this is this by apple policy? Any work around?