-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bufferStalledError on iOS 18.0.1 when looping video #6890
Comments
Related to requests to enhance looping support:
If playback is not looping, then the issue is that the 'ended' event is not being emitted. This bug resurfaces frequently in Safari. I recommend trying the latest canary build, and also verifying that the end of your audio and video tracks are aligned. |
hls.js is calling
After that, Safari does not emit the "ended" event (or handled correctly by seeking back to 0 when the loop attribute is set). The starting/stopping is coming from calls to |
I can confirm that this is still happening in the latest version of hls (1.5.20) and happens in both Safari and Chrome on iOS |
Hi @gkashe, Chrome and Safari both use WebKit on iOS so don't expect behavior to be any different there. The comment above describes the bug in part (the "ended" event is not emitted). You can try hls.js@v1.6.0-beta.2 - while it doesn't work around any flaws in the browsers handling of playback or looping at end-of-stream, HLS.js does detect when playback has ended and will emit MEDIA_ENDED which you can use in the place of "ended" on platforms with this bug. You can also try a build of #6972 if you are following along with development as this revamps the code responsible for stall detection. |
I was able to reproduce in latest and found a workaround where delaying the call to |
What version of Hls.js are you using?
1.5.15
What browser (including version) are you using?
Mobile Safari 18.0.1
What OS (including version) are you using?
iOS 18.0.1
Test stream
https://hlsjs.video-dev.org/demo/?src=https%3A%2F%2Fvz-dfb04804-1a1.b-cdn.net%2Fe769e9cc-2c93-4179-911f-64d0b88fc0ba%2Fplaylist.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOnRydWUsInN0b3BPblN0YWxsIjpmYWxzZSwiZHVtcGZNUDQiOmZhbHNlLCJsZXZlbENhcHBpbmciOi0xLCJsaW1pdE1ldHJpY3MiOi0xfQ==
Configuration
Additional player setup steps
Player needs to have loop enabled
Checklist
Steps to reproduce
In the demo page I managed to get this done by adding the "loop" attribute to the video element manually by connecting my iPhone to a Mac. I didn't see any toggle or option in the page for it.
Alternatively you can reproduce it by playing the video here: https://iframe.mediadelivery.net/embed/183266/e769e9cc-2c93-4179-911f-64d0b88fc0ba?autoplay=false&loop=true&muted=true&preload=false
Expected behaviour
Video should loop from the start
What actually happened?
Video stops on the last frame and there is bufferStalledError in the console. Code is also stuck on some loop based on console logs.
This happens almost every time on the first loop, but sometimes it might take two or more loops.
In the canary version (https://hlsjs-dev.video-dev.org/demo) this happens much more rarely for some reason, but I observed it happen.
Console output
Chrome media internals output
No response
The text was updated successfully, but these errors were encountered: