Closed Bug 1617591 Opened 5 years ago Closed 5 months ago

Screen timeout for videos composed of audio+image

Categories

(Web Compatibility :: Site Reports, defect, P2)

ARM64
Android

Tracking

(firefox88 affected, firefox100 affected, firefox111 affected)

RESOLVED WORKSFORME
Tracking Status
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)

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.

Component: General → Audio/Video: Playback
Product: GeckoView → Core
Whiteboard: [geckoview]

(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:

  1. Audio-only media (like in soundcloud) - doesn't acquire screen wakelock, however it continues playing after sleep
  2. Media with <video> tag, with only static image(thumbnail) displayed and audio (like in music.youtube.com) - acquires screen lock
  3. Videos - acquires screen lock

Our behaviour:

  1. Audio-only media (like in soundcloud) - doesn't acquire screen wakelock, and it puts media in Stopped state after sleep
  2. 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
  3. 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?

This looks like a media team issue. Can you please triage?

Flags: needinfo?(bvandyk)
Flags: needinfo?(bvandyk) → needinfo?(alwu)
Whiteboard: [geckoview] → [geckoview:p3]

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.

Component: Audio/Video: Playback → General
Flags: needinfo?(alwu)
Product: Core → Firefox for Android

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.

Priority: P3 → --
Product: Firefox for Android → GeckoView
Rank: 15
Priority: P3 → P2
Whiteboard: [geckoview:p3] → [geckoview:p3][fenix:q2:2020]
Whiteboard: [geckoview:p3][fenix:q2:2020] → [geckoview:m79][fenix:q2:2020]
Priority: P2 → P1

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.

Component: General → Mobile
Product: GeckoView → Web Compatibility
Whiteboard: [geckoview:m79][fenix:q2:2020] → [fenix:q2:2020]

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)

Assignee: nobody → kdubost

The issue is still reproducible.

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)

Flags: needinfo?(dschubert)

Sorry, there was a problem with the detection of inactive users. I'm reverting the change.

Assignee: nobody → karl+moz
Severity: normal → S3
Assignee: karl+moz → nobody

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)

Assignee: nobody → kberezina
Status: NEW → ASSIGNED
Component: Mobile → Site Reports
User Story: (updated)
Priority: P1 → P2

@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.

Flags: needinfo?(rbucata)

@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)

Flags: needinfo?(rbucata)
Attached video 20240716_170409.mp4

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.

User Story: (updated)

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.

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.

Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → WORKSFORME
Whiteboard: [fenix:q2:2020] → [fenix:q2:2020][webcompat:sightline]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: