Open lunatic-hombre opened 5 years ago
Hi @lunatic-hombre, have you got any fix? I faced the same issue in Howler library that audio doesn't play in loop when Android browser window is in background or phone is locked.
Yes and no, my solution to the problem was to stop using howler.
@lunatic-hombre which library you used instead? I am trying native HTML5 audio player but looping isn't seamless.
Currently using a HTML5 node as a MediaElementAudioSourceNode in Web Audio API. I don't think the looping is seamless though.
Ok, I'll give it a try and few other things as well and update you in case of any success. :)
One other thing of note that I've discovered recently - MediaElementAudioSourceNode doesn't work on the new version of iOS (iOS 13). I submitted a feedback entry a few weeks ago but haven't gotten any response.
It seems that iOS is giving hard time to web developers. I need to play two audios simultaneously even when the app goes in background. Unfortunately iOS had been a real disappointment as compared to Android. Play/Pause controls in Notifications, Call interruptions etc. are more stable in Android as compared to iOS.
It appears to be caused by some timeout javascript happening behind the scenes for the seamless looping, because browsers will not execute background javascript outside of web workers.
I can work around the issue by using straight javascript calls to the audio element API with loop=true instead of using Howler.
When investigating, I saw the audio elements under
_sounds[0]._node
had loop=true, so I'm a bit confused why it's not working.