Closed Bug 1548296 Opened 5 years ago Closed 5 years ago

Picture-and-Picture toggle is not responsive for videos that fire their canplay events outside of the document

Categories

(Toolkit :: Video/Audio Controls, defect, P2)

68 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla71
Tracking Status
firefox68 --- wontfix
firefox71 --- verified

People

(Reporter: mconley, Assigned: mconley)

References

Details

Attachments

(3 files)

Attached file Test case

PictureInPictureToggleChild inside of PictureInPictureChild.jsm uses the "canplay" event to register videos for tracking mouse movement, and hearing about clicks that might be on the toggle.

I've found an example case[1] where clicking on the toggle does nothing - this is because the "canplay" event is fired at a point where the <video> element is disconnected from the DOM tree, so the PictureInPictureToggleChild (which attaches the "canplay" listener to the message manager) doesn't hear about it.

This means that we never end up tracking the video.

I've attached a test case.

Attachment #9061931 - Attachment mime type: text/plain → text/html
Priority: -- → P3
Blocks: 1546639

I suspect this also affects Netflix (bug 1546639), so increasing priority.

Priority: P3 → P2

Videos can fire their "canplay" events even when they're not part of the DOM. This
means that videos that have already fired that event won't get the
PictureInPictureToggleChild properly attached after being inserted.

The UAWidgetSetupOrChange event, however, is fired for video events once they've
been bound to the DOM, so we can use that instead.

Depends on D44541

Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/11b2692199c2
Attach Picture-in-Picture toggle on UAWidgetSetupOrChange event rather than canplay. r=JSON_voorhees
https://hg.mozilla.org/integration/autoland/rev/78e7e7cb5073
Regression test. r=JSON_voorhees
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Assignee: nobody → mconley

Build ID 20190906094324
User Agent Mozilla/5.0 (Windows NT 10.0; rv:71.0) Gecko/20100101 Firefox/71.0

Verified as fixed on the latest Nightly build. The PiP toggle is now displayed for the Netflix videos (bug 1546639).

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

Attachment

General

Created:
Updated:
Size: