Screen timeout for videos composed of audio+image
Categories
(Web Compatibility :: Site Reports, defect, P2)
Tracking
(firefox88 affected, firefox100 affected, firefox111 affected)
People
(Reporter: mbranescu, Assigned: ksenia)
References
()
Details
(Keywords: webcompat:needs-diagnosis, webcompat:site-report, Whiteboard: [fenix:q2:2020][webcompat:sightline])
User Story
platform:android impact:feature-broken configuration:general affects:all branch:release diagnosis-team:media
Attachments
(1 file)
4.98 MB,
video/mp4
|
Details |
When playing a video on music.youtube.com, the screen stays active. When playing a song(only image+audio) on the same website, the screen times out and audio gets cut off. This happens both on Fenix and Fennec.
Probably in this case a wakelock doesn't get acquired because of the video type.
I don't see any way of getting the media type in AC, so I assume the issue might be here.
Associated Fenix bug: https://github.com/mozilla-mobile/fenix/issues/5133
So you want audio-only media to acquire a screen wakelock? That seems reasonable to me. Over to media.
Reporter | ||
Comment 2•5 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) (he/him) from comment #1)
So you want audio-only media to acquire a screen wakelock? That seems reasonable to me. Over to media.
Not exactly, I'll give an example.
Behaviour in Chrome:
- Audio-only media (like in soundcloud) - doesn't acquire screen wakelock, however it continues playing after sleep
- Media with <video> tag, with only static image(thumbnail) displayed and audio (like in music.youtube.com) - acquires screen lock
- Videos - acquires screen lock
Our behaviour:
- Audio-only media (like in soundcloud) - doesn't acquire screen wakelock, and it puts media in Stopped state after sleep
- Media with <video> tag, with only static image(thumbnail) displayed and audio (like in music.youtube.com) - doesn't acquire screen wakelock, and it puts media in Stopped state after sleep
- Videos - acquires screen lock
So the issue seems to be that we treat videos with static image + audio like we do with audio, while Chrome treats them like actual videos. Is it a bit clearer from this example?
Comment 3•5 years ago
|
||
This looks like a media team issue. Can you please triage?
Updated•5 years ago
|
Comment 4•5 years ago
|
||
So here are two different topics, (1) should we request screen wakelock for media without video track (2) media would not be stopped after sleep
For (1), I don't think we have to request wakelock for image-only media, using <video>
tag to play a audio is not rare in the wild, we should only request screen wakelock when we really have video track.
For (2), I agree with that, but in our media code, we won't pause or stop media after phone goes sleep, I think that is controlled by the app itself (fennec/fenix). I know there was a zombify mechanism in Fenne before which would kill tab to reduce the memory usage, and it sometime unexpectely killed the tab which is playing media. I don't know if we have any similar mechanism in Fenix or not, but that would need some investigation from Java side.
Comment 5•5 years ago
|
||
The product::component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit auto_nag documentation.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 6•5 years ago
|
||
Blocks Fenix issue: https://github.com/mozilla-mobile/fenix/issues/5133
Updated•5 years ago
|
I think the issue here is actually that music.youtube.com
, like youtube.com, uses the page visibility API to pause the media. We won't be able to solve this without an extension or some other content intervention.
We do not pause media in Fenix when the app is backgrounded (or at least it's an option).
Moving this to web compat.
Comment 8•4 years ago
|
||
The issue still occurs.
Tested with:
Browser / Version: Firefox Nightly 210302 (🦎 88.0a1-20210301093612)
Operating System: Samsung Galaxy S8 (Android 9) - 1440 x 2960 pixels, 18.5:9 ratio (~570 ppi density)
![]() |
||
Updated•4 years ago
|
Comment 9•3 years ago
|
||
The issue is still reproducible.
-
If you play any song that has an actual video ✔️ The screen does not go to sleep.
URL: https://music.youtube.com/watch?v=DtVBCG6ThDk&list=RDCLAK5uy_nZiG9ehz_MQoWQxY5yElsLHCcG0tv9PRg -
If you play the audio (doesn't have an actual video) ❌The screen goes to sleep and the playback is paused.
URL: https://music.youtube.com/watch?v=WhWnmRxIWRo&list=OLAK5uy_lB4if5u3J1ZLbx4CplMD6aPUZtzftKU1A
Tested with:
Browser / Version: Firefox Nightly 100.0a1 (🦎 100.0a1-20220323094932)
Operating System: Google Pixel 5 (Android 12) - 1080 x 2340 pixels, 19.5:9 ratio (~432 ppi density), Samsung Galaxy S8 (Android 9) - 1440 x 2960 pixels, 18.5:9 ratio (~570 ppi density)
Comment hidden (off-topic) |
Updated•3 years ago
|
Comment 11•3 years ago
|
||
Sorry, there was a problem with the detection of inactive users. I'm reverting the change.
Updated•2 years ago
|
![]() |
||
Updated•2 years ago
|
Comment 12•2 years ago
|
||
The issue si still reproducible for: https://music.youtube.com/watch?v=WhWnmRxIWRo&list=OLAK5uy_lB4if5u3J1ZLbx4CplMD6aPUZtzftKU1A
Tested with:
Browser / Version: Firefox Nightly 111.0a1 (2015932395-🦎111.0a1-20230208095231🦎)
Operating System: Samsung A51 (Android 11) -1080 × 2400 pixels 20:9 aspect ratio (~405 ppi density)
Operating System: Google Pixel 3 (Android 12) -1080 x 2160 pixels, 18:9 ratio (~443 ppi density)
Updated•2 years ago
|
Updated•1 year ago
|
Assignee | ||
Updated•10 months ago
|
Comment 13•8 months ago
|
||
@Raul, is this still reproducible? I just tried your link in comment 12 in the Android emulator, and it seems like YT Music is requesting a wake-lock on the screen.
Comment 14•8 months ago
|
||
@Tom it seems that it tries to redirect you to the app or Google Store if you do not have the YouTube music app installed, but Chrome does not do this. This happens 5/10 times. Regardless of whether this happens, I can still reproduce the bug. Refreshing the page solves the issue, as it seems that this is conditioned by the ads not starting at first. See attachment
Tested with:
Browser / Version: Firefox Nightly 130.0a1 (2016032583-🦎130.0a1-20240714194554🦎)
Operating System: Google Pixel 3 (Android 12) -1080 x 2160 pixels, 18:9 ratio (~443 ppi density)
Operating System: Oppo Find X5 (Android 13) - 1080 x 2400 pixels, 20:9 ratio (~402 ppi density)
Comment 15•8 months ago
|
||
Comment 16•6 months ago
|
||
I'm a bit confused about the status here. Comment #4 suggests that the Fenix code needs to request different behaviour in this case, but comment #7 suggests that Google are using the page visibility API to pause the media on sleep (presumably in Firefox but not in Chrome). So in terms of diagnosis, I think we need to check if that is the case; if so we might be able to ship an intervention, but will certainly require outreach. Otherwise there is some platform bug to investigate.
Comment 17•6 months ago
|
||
I tried to reproduce this issue on the latest Nightly 133 on Android 14, but I couldn't reproduce it. When playing music from music.youtube
, the screen won't go dark anymore. When the music is paused, the screen will go dark correctly when the timeout threshold is reached.
As the wake lock API has been implemented, Youtube music must be requesting a wakelock when playing a music, and release it when no music is playing.
For Gecko media implementation, we will only request a screen wakelock when there is a video. For audio only playback, we will only request a audio wakelock to prevent device from being sleeping, but won't keep screen on.
I will suggest to close this bug, unless the issue is still able to be reproduced on other people's devices.
Comment 18•5 months ago
|
||
The current state of things is as such:
- YouTube (regular and music) have the policy to pause media when the page isn't visible (app in background, screen off, different tab, etc.), using the Visibility API. It is a paying feature to be able to play in the background (https://support.google.com/youtube/answer/6308116?hl=en#zippy=%2Cbackground-play, this talks about the mobile app, but it's the same on the Web).
- Chrome behaves the same
- We've shipped audio wakelock quite recently
- If I open a random YouTube music link on my phone, and I play, the screen will not go to sleep, music will continue playing, then the next track will load an play, etc.
I'm closing this, please reopen if needed.
Updated•4 months ago
|
Description
•