Closed Bug 1940052 Opened 1 year ago Closed 1 year ago

PIP Mode video cut issue when on desktop mode (youtube.com).

Categories

(Firefox for Android :: Media, defect)

Firefox 135
All
Android
defect

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox134 --- wontfix
firefox135 --- wontfix
firefox136 --- wontfix
firefox140 --- fixed

People

(Reporter: ritobroto.upadhyay, Assigned: calu)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][group4])

Attachments

(7 files, 1 obsolete file)

Steps to reproduce

  1. Enter Firefox app
  2. Change desktop site to ON
  3. Search YouTube in search bar
  4. Once YouTube opens, play videos in landscape mode
  5. Now from quick tile, go to settings
  6. Browser goes to PIP mode.

Expected behavior

Video should play normally

Actual behavior

Blank screen or video cut issue is observed.

Device information

  • Firefox version: 135
  • Android device model:
  • Android OS version: 12

Any additional information?

verified in chrome. Video plays normally in PIP mode for Desktop site ON

This issue needs to be resolved on urgent basis. So, please let us know if there is any update on the reported issue.

Severity: -- → S1
Priority: -- → P1
Summary: PIP mode bug → PIP Mode video cut issue.

Thanks for the report.
Severity and Priority are set based on this guide, which explains why I'm resetting them.

I cannot reproduce this bug. Which Android device model are you using? 
Can you please provide a screencast of this bug?

Priority: -- → P1
Severity: S1 → --
Priority: P1 → --
Attached image Issue image

First Device Details

Device Name - Samsung s21 FE
Mozilla Firefox Version - 133.0.3
Android Version - 14

Second Device Details

Device name - Galaxy Tab A SM-T510
Mozilla Firefox Version - 133.0.3
Android version - 11

Steps to reproduce the issue

  1. Open Firefox App
  2. In search and address bar type Youtube
  3. Click on www.youtube.com
  4. Click on any videos
  5. Once video is playing, from the menu icon turn ON Desktop Site
  6. Play the video
  7. Click on full screen icon there in video (Video will go to landscape mode).
  8. Click on the edge of the screen to get the bottom navigation bar.
  9. Click on Home button with video still playing and in full screen mode
  10. Now, video goes in PIP mode.
  11. Observe the video. Either screen goes blank or cut issue is observed while video is still playing.

Note : I have attached the screenshot of the issue in attachment section

Attached image PIP in chrome

The description details - Issue image - PIP view in Firefox
The description details - PIP in chrome - PIP view in Chrome

In both the scenario same video is being played.

Attachment #9446563 - Attachment filename: image.png → firefoxPIPIssue.png

The severity field is not set for this bug.
:titouan, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(tthibaud)

I cannot reproduce this (tested on Xioami Mi 9, Android 11 ; Pixel 7, Android 15).

Can someone from QA reproduce this?

Flags: needinfo?(tthibaud) → qe-verify+

Any updated if QA is able to reproduce the issue? Because, it is 100% producible with the above mentioned steps.

Attached image QA.jpg

Confirming this issue is reproducible as described on all latest releases (Nightly 136.0a1 from 01/30, Beta 135.0b9 and Release 135.0). Tested with Samsung Galaxy A53 5G (Android 14), Samsung Galaxy Note 8 (Android 12) and LG G7 fit (Android 9).

Severity: -- → S3
Flags: qe-verify+

Dear Team,

Since, the issue is reproduced, could you please let me know the next step towards resolving the issue?

Thanks.

Dear Titouan Thibaud

Please let me know if there in any update on the issue?

thanks.

Dear Team,

Do we have any update on the issue?

Dear Team,

As per QA Delia Pop, the issue is reproducible. However, I am yet to receive any update from your end. So, please let me know if there is any information regarding the issue.

Whiteboard: [fxdroid][group4]

Hey Alastor, Can you take a look at this bug, why in desktop mode, pip mode video is not showing properly?

Android PictureInPicture (https://developer.android.com/develop/ui/compose/system/picture-in-picture) puts the top of the screen into a pip screen. Unlike most video sites, Youtube desktop mode fullscreen doesn't just include the video, it also allows users to scroll down to see the video description. It's basically just the Youtube page in full width. So sometimes pip mode shows a black screen or it'll put the Youtube toolbar into the pip screen. It happens because when you move from fullscreen to pip, youtube shows the toolbar very quickly. You can reproduce this more consistently when you scroll down in the page.

On the Android side, there's no way we can tell PictureInPicture Builder to put a specific part of the layout into pip. One solution would be to scroll the website to the top of the video so just the video is displayed in pip, but that would be susceptible to any changes Youtube makes to the site.

Since we've enabled desktop mode by default for all large screen/tablet devices, this bug will impact many more users. All tablet users will have issue with youtube in pip mode.

Is there something that can be done on the media side?

Flags: needinfo?(alwu)

John, is this something you could help with? This issue seems only happening on the desktop mode. Thanks!

Flags: needinfo?(alwu) → needinfo?(jolin)

When in PIP mode, DevTools Page Inspector shows the video element top position is out of
viewport: <video tabindex="-1" class="video-stream html5-main-video" controlslist="nodownload" src="blob:https://www.youtube.com/8c4dc1c7-be56-438d-92f2-1193ee10cd4d" style="width: 195px; height: 110px; left: 0px;top: 185px;"></video>. After setting the top value to 0, the video content shows up.

On the other hand, chrome://inspect shows that the video element top value is 0 in Chrome: <video tabindex="-1" class="video-stream html5-main-video" controlslist="nodownload" style="width: 192px; height: 108px; left: 0px; top: 0px;" src="blob:https://www.youtube.com/9e84d97d-6353-440e-a65b-f1cffd6d0edd"></video>

What causes the layout differences is not clear, though.

Flags: needinfo?(jolin)

Hi, Emilio, do you have any thought in terms of the comment 21? I wonder if this is something related with bug 1948841. Thanks!

Flags: needinfo?(emilio)

I took a look, and no, it's not related to bug 1948841. What's going on is that Chromium has a special state that they set when they enter this "video in PiP" mode:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/media/web_media_player_impl.cc;l=899;drc=cd505209c612e3b9e5aa7e574ba35b297ec794dc

Which basically ends up setting a flag in the <video> element, which makes it apply this rule:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/css/fullscreen.css;l=68;drc=4670338ccf46aaf26aee2402b0f722106d55b003

We could implement something like that without much trouble, I'd think. Main thing is making sure we have a flag telling us whether we're in this special "PiP fullscreen" state.

Flags: needinfo?(emilio)
See Also: → 1956165

Emilio, is the flag for Pip something the Android team can help with? Otherwise, is this something that can be fixed from your team soon?

Flags: needinfo?(emilio)

It'd be useful to have someone from the android team at least implement the plumbing to get this into Gecko, yeah. I can mentor with the CSS bits, not sure I can commit to implementing it soon myself tho.

Flags: needinfo?(emilio)

Thanks Emilio, we can try to work on this soon. Do you have an example of how the CSS would be altered for the video in our existing code source? I'm wondering if it is just GeckoView calling a toolkit API to modify the CSS.

Flags: needinfo?(emilio)

I'd plumb it similarly to how full-screen / display mode is plumbed... This kinda feels like a separate displayMode value?

Like here, IIUC.

Flags: needinfo?(emilio)
Summary: PIP Mode video cut issue. → PIP Mode video cut issue when on desktop mode.
Summary: PIP Mode video cut issue when on desktop mode. → PIP Mode video cut issue when on desktop mode (youtube.com).
Depends on: 1958322
Attachment #9480463 - Attachment is obsolete: true
Assignee: nobody → calu
Status: NEW → ASSIGNED
Attachment #9480467 - Attachment description: WIP: Bug 1940052 - Apply fixed position css to Android pip media query → Bug 1940052 - Apply fixed position css to Android pip media query
Pushed by calu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8aaff6c4db6d Apply fixed position css to Android pip media query r=emilio,twisniewski
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED

Can QA verify that pip mode is not working on desktop mode site?

Flags: qe-verify+
Target Milestone: --- → 140 Branch

Verified on the latest Nightly build (140.0a1 from 2025-04-30).

PiP works as expected, on some devices (example: Xiaomi Redmi Pad SE with Android 12 - Where desktop mode is by default).
Sometimes the screen is zoomed in, so the video is only partially displayed (example on a Google Pixel 7 with Android 16).
Sometimes the Youtube bar is present, cutting the video (example: Samsung Galaxy S23 Ultra with Android 14).

Flags: qe-verify+
Blocks: 1972817
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: