-
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
Video pauses itself when 2 tabs are opened on the same stream #5306
Comments
Reproductible with HLS 0.14.0. |
Sounds like it could be an Android Chrome issue. Have you tried reporting this to Google? There's nothing in HLS.js that interacts with multiple tabs in browser directly. |
I can reproduce as well on Firefox android by the way. |
Can you provide complete console log output from a session that displaying this issue (one for each tab)? |
I have noticed that live playlist refresh is delayed after level switch. It doesn't match what you've described but it could result in stalls if a lot of live level switching occurs on start (unless the live stream uses low latency blocking reload). |
#5317 has been merged. You can test the changes on dev at https://hlsjs-dev.video-dev.org/demo/ |
Hello, I have just tried hls demo page on my android with |
More info: 1. Cannot reproduce with 2 video tags in a single tabCodepen Seps to reproduce
Result Both videos are playing normally Notes The bug can be reproduced by opening a second tab on the same codepen 2. Destroying hls and loading an other m3u8 does not fixCodepen https://codepen.io/dmail/pen/WNgamxw Seps to reproduce
Result The VOD loads and starts to play. 3. Does not happen with mp4Playing the same mp4 url in two tabs works fine (video play in the second tab, it does not pause itself) |
Which tab does it pause in? Can you clarify? I would expect a majority of mobile devices or browsers to only allow one active media source for audio, otherwise you would hear strange mixes of audio when backgrounding apps or tabs. If the background tab is playing and the foreground is pausing, that is odd, but still an Android issue and not an HLS.js issue. |
Unfortunately it's the foreground tab that is pausing. I'll open an issue on chrome tracker and link it here |
Is there any progress on this case? I have also looked for chrome tracker but could not find the corresponding issue. If you have found another solution, I would like to know how to do that. By the way, when I fall into the event reported by @dmail, even native apps such as Youtube App and Spotify App play for a few seconds and stop playing on their own. Translated with www.DeepL.com/Translator (free version) |
Issue opened on chromium at https://bugs.chromium.org/p/chromium/issues/detail?id=1432833 |
Thanks for the information. |
Bug opened on firefox too at https://bugzilla.mozilla.org/show_bug.cgi?id=1828431 |
I have same issue on Android, when play the streaming, other native apps or new tab player are auto paused. When I destory hls player and stay on my production tab(Chrome browser), then switch to youtube and play any video that will auto pause. But when I switch to other tab, youtube could play normally. |
From https://bugs.chromium.org/p/chromium/issues/detail?id=1432833
HLS.js updates the duration as new segments are parsed and appended whose duration exceed their playlist duration. The chromium issue acknowledges that this is something MSE players do commonly. It is not something that HLS.js should have to change. The duration is updated as necessary as media is streamed to ensure that after the last segment is appended, when played to the end, the video can end correctly (rather than stall), loop if set to do so, all while providing an accurate duration for the media appended. And that's just for VOD. With live the duration and seekable range are constantly updated unless There is a way to workaround this issue. If the media is paused and the tab backgrounded (visibilitychange event), hls.stopLoad() can be called to stop network activity. When the tab is foregrounded, use |
In a Vue.js application, I have logic to open HLS Video Streaming same video in two different browser tabs simultaneously. How would this functionality translate when converting the application into an Android application? Can the concept of 'new tabs' exist in an Android WebView? ( Considering same vuejs code is converted to Android App ) I'm actually able to reproduce the error even when it's opened in Android application ( Where I feel there is no concept of tabs ) |
Edit:
This bug is on browser side, likely introduced by https://developer.chrome.com/blog/media-updates-in-chrome-63-64/#background-video-track-optimizations
Chromium bug tracker: https://bugs.chromium.org/p/chromium/issues/detail?id=1432833
Firefox bug tracker: https://bugzilla.mozilla.org/show_bug.cgi?id=1828431
What version of Hls.js are you using?
1.3.4
What browser (including version) are you using?
Chrome android 111.0.5563.58
What OS (including version) are you using?
Android 10
Test stream
https://hls-js-73965559-fca4-40e5-9cde-d90859bfc224.netlify.app/demo/?src=https%3A%2F%2Fmoctobpltc-i.akamaihd.net%2Fhls%2Flive%2F571329%2Feight%2Fplaylist.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOnRydWUsInN0b3BPblN0YWxsIjpmYWxzZSwiZHVtcGZNUDQiOmZhbHNlLCJsZXZlbENhcHBpbmciOi0xLCJsaW1pdE1ldHJpY3MiOi0xfQ==
Configuration
Additional player setup steps
No response
Checklist
Steps to reproduce
Expected behaviour
Video plays normally in the second tab
What actually happened?
Video pauses by itself. When playing, it plays a few video fragments and pause by itself again.
Console output
Chrome media internals output
No response
The text was updated successfully, but these errors were encountered: