Closed Bug 1762042 Opened 2 years ago Closed 2 years ago

Picture in Picture button doesn't show up on BBC iplayer and other BBC uses of the SMPToucan player

Categories

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

Desktop
All
defect
Points:
5

Tracking

()

VERIFIED FIXED
101 Branch
Tracking Status
firefox100 --- wontfix
firefox101 --- verified
firefox102 --- verified

People

(Reporter: Gijs, Assigned: molly)

References

Details

(Whiteboard: [fidefe-MR1-2022])

Attachments

(2 files, 1 obsolete file)

This is a recent regression caused by changes in the iPlayer website.

I don't really know what happened but it appears that their player has changed and now the icon doesn't show up. The context menu also doesn't indicate we're dealing with a video element, so I suspect iplayer is doing something other than just using a <video> element. The custom site context menu says "SMPToucan 1.9.8", and the actual video element is inside a shadow DOM, which perhaps is why we're not finding it and overlaying PiP on it?

This is a pretty big deal given that BBC, the UK's public broadcaster, gets billions of streams a quarter - https://www.bbc.co.uk/mediacentre/2021/iplayer-record-breaking-start-to-2021 .

Severity: -- → S2
Priority: -- → P2
Whiteboard: [fidefe-MR1-2022]

More internationally usable links: https://www.bbc.co.uk/food/techniques/julienne and https://www.bbc.co.uk/weather both have videos that should show PiP toggles.

Summary: Picture in Picture button doesn't show up on BBC iplayer → Picture in Picture button doesn't show up on BBC iplayer and other BBC uses of the SMPToucan player

As Gijs surmised, the issue appears to be that the <video> element is housed inside the shadow DOM of a component (<smp-playback>) which is itself housed within the shadow DOM of a higher-level component (<smp-toucan-player>). That means that this nodesFromRect call returns only that <smp-toucan-player> custom element, and none of its shadow children or grandchildren, so PIP never really sees the <video> element when it gets moused over. We'll have to find a way to drill through those two shadow layers if we want to fix this.

Assignee: nobody → mhowell
Status: NEW → ASSIGNED
Points: --- → 5

This is a ChromeOnly method so it makes sense to avoid retargetting to
the root scope and just return the raw elements.

Attachment #9273668 - Attachment description: WIP: Bug 1762042 - Avoid retargetting in NodesFromRect. → Bug 1762042 - Avoid retargetting in NodesFromRect. r=mhowell,mconley
Attachment #9273668 - Attachment description: Bug 1762042 - Avoid retargetting in NodesFromRect. r=mhowell,mconley → Bug 1762042 - Avoid retargeting in NodesFromRect. r=mhowell,mconley
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0cec4dbebc87
Avoid retargeting in NodesFromRect. r=mconley

Backed out changeset 0cec4dbebc87 (bug 1762042) for causing perma mochitest failures in browser_toggleTransparentOverlay.

Backout link: https://hg.mozilla.org/integration/autoland/rev/11692659edaa84dea699a87eed43e12915c37864

Push with failures

Failure log

Flags: needinfo?(mhowell)

:emilio, I don't really understand what's happening here, but somehow this patch has changed the behavior when the visibility threshold parameter to NodesFromRect is used, such that we're no longer drilling through a fully transparent element when this test sets the threshold to 0.4. Any ideas?

Flags: needinfo?(mhowell) → needinfo?(emilio)

Before, these nodes were being retargeted and the video element was
being returned instead. Now we return the clickable control directly.

Since we pass aOnlyVisible, when the toggle is fully opaque we don't
return the video element itself otherwise, and this code was bailing
out.

Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e709dbc43832
Avoid retargeting in NodesFromRect. r=mconley
https://hg.mozilla.org/integration/autoland/rev/1b4ac129a74b
Deal with nodesFromRect returning elements inside the video controls but not the video itself in PictureInPictureChild. r=mconley
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch

This fix was verified on Nightly v102.0a1 and Beta v101.0b3 (20220504181604) on Windows 10, Ubuntu 20.04.4 LTS, Windows 7 and Mac OS 11.
The PiP toggle is displayed correctly.

Status: RESOLVED → VERIFIED
Attachment #9273494 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: