Closed Bug 1770429 Opened 2 years ago Closed 1 year ago

Picture on picture subtitles don't update unless firefox is visible

Categories

(Toolkit :: Picture-in-Picture, defect, P1)

Firefox 102
Desktop
Unspecified
defect

Tracking

()

VERIFIED FIXED
111 Branch
Tracking Status
firefox111 --- verified

People

(Reporter: luis.pabon, Assigned: kpatenio)

References

Details

(Whiteboard: [fidefe-MR1-2022])

Attachments

(3 files)

Steps to reproduce:

In sway 1.7 (wayland), Ubuntu 22.04 and FF nightly 102.0a1 (2022-05-18)

  1. Open firefox nightly
  2. Go to youtube, open a vid like this one https://www.youtube.com/watch?v=TWP0YpfvGvM and enable closed captions
  3. Activate PIP
  4. Open some other app side by side on same workspace and give it focus
  5. Subtitles still work
  6. Switch to tabbed mode and ensure the main firefox window is not visible
  7. Subtitles don't update anymore
  8. Switch to the tab with firefox, making it visible
  9. Subtitles now catch up

I've uploaded a screengrab showing just this scenario.

Actual results:

Subtitles on PIP window stop updating if the main FF window is not visible

Expected results:

Subtitles continue to update

The issue is also present on FF beta (101).

I am unable to turn off the wayland backend in Firefox and make it run in Xwayland though to check it's a wayland thing or what. Unsetting MOZ_ENABLE_WAYLAND then launching firefox doesn't seem to have an effect and it still loads in wayland mode.

Attachment #9277491 - Attachment description: recording.mp4 → broken recording please ignore
Attachment #9277491 - Attachment filename: recording.mp4 → broken recording please ignore
Attached video recording.m4v

For some reason the first vid I uploaded just won't play on firefox with a mp4 mime type. Atttaching the same thing as m4v

The Bugbug bot thinks this bug should belong to the 'Toolkit::Picture-in-Picture' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Picture-in-Picture
Product: Firefox → Toolkit

Hmm. This looks like it ought to be the same thing as bug 1755748, but that one only fixed the tab being blurred, not the whole app. Mike, do you know if there's something similar we could do at the app level that might address this, or is it not going to be that easy?

Flags: needinfo?(mconley)
See Also: → 1768172

Hm... this might be related to window occlusion handling in AsyncTabSwitcher. The platform fires "window occlusion" changes. We handling occlusion state changes here: https://searchfox.org/mozilla-central/rev/1c391443f770eddc7cde9e52dba5ef50cc233c06/browser/modules/AsyncTabSwitcher.jsm#855-857

and we do seem to try to handle the PiP case in shouldDeactivateDocShell here: https://searchfox.org/mozilla-central/rev/1c391443f770eddc7cde9e52dba5ef50cc233c06/browser/modules/AsyncTabSwitcher.jsm#926

If this is easily reproducible (and I expect it is), it'd be worth checking to see if that's working properly. If it is, we might have an issue deeper in the platform.

Flags: needinfo?(mconley)

I can reproduce it every time on my system.

Severity: -- → S3
Severity: S3 → S2
Priority: -- → P1
Assignee: nobody → asafko
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee: asafko → mhowell
Whiteboard: [fidefe-MR1-2022]
Duplicate of this bug: 1797501
Assignee: mhowell → kpatenio
Attachment #9311871 - Attachment description: WIP: Bug 1770429 - set PiP originating window as active when window is occluded → Bug 1770429 - set PiP originating window as active when window is occluded
Duplicate of this bug: 1810380

Based on my experience on bug 1810380, it seems like if the issue also doesn't happen if the tab is not selected (i.e. if the tab with the video is not the selected tab, it behaves correctly). So switching to a different tab is a workaround. I'm not sure if that's consistent with the patch or not.

Pushed by kpatenio@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1da22d92c592
set PiP originating window as active when window is occluded r=mconley,pip-reviewers
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch

This fix has been tested on Windows 7, 10, 11, Ubuntu 22 and Mac OS 11 and 12 with Nightly v111.0a1 from 2022-02-02.

We've tested the following scenarios:

  1. Open a new profile.
  2. Load 2 youtube videos with subs:
    2.a generic/loaded subs
    2.b auto-generated subs
  3. Launch PiP and activate subs
  4. minimize the window and check that subs are not delayed in PiP
  5. put another window over the Fx window and check that subs are not delayed in PiP
  6. send the PiP/ main window to another desktop and check that subs are not delayed in PiP
  7. focus another tab on the Fx browser and check that subs are not delayed in PiP

All scenarios and operating systems suggest that the issue was fixed except for one situation: on Mac OS (both 11 and 12) the subtitles are still displayed with a delay if the main window is minimized (and only in this situation of the ones tested).

This being said, this report is partially fixed. Considering that the fix appears to be complete on the other operating systems, I suggest we close this report, reopen duplicate bug 1786258 and attempt to fix the remaining issue there. If you think this is an acceptable procedure, let me know to make the necessary changes. Thank you!

Flags: needinfo?(kpatenio)
Hardware: Unspecified → Desktop

Thanks :danibodea - I agree, let's use Bug 1786258 for MacOS.

Flags: needinfo?(kpatenio)
No longer duplicate of this bug: 1786258
See Also: → 1786258

I will verify this report based on comments 14 and comment 15 and reopen bug 1786258.

Status: RESOLVED → VERIFIED
See Also: → 1837124
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: