Closed Bug 1622919 Opened 9 months ago Closed 9 months ago

Picture-in-Picture toggle should re-evaluate visibility on video duration change

Categories

(Toolkit :: Video/Audio Controls, enhancement)

enhancement
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla76
Tracking Status
firefox76 --- verified
firefox77 --- verified

People

(Reporter: mconley, Assigned: mconley)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Currently, we use some heuristics to determine whether or not to display the toggle. One heuristic we use is to only show the toggle for videos that are 45 seconds or longer. This works well on most sites, but on some sites, the duration on the video element changes after the metadata has been made available.

Live videos on https://www.cbc.ca/news, for example, are like this.

We should listen for the durationchange event, and re-evaluate the visibility of the toggle.

Unfortuntely, this seems pretty hard to write an automated test for -
I can't seem to tease our media stack into firing durationchange
events, or tricking the video into thinking its duration has
gotten longer.

Assignee: nobody → mconley
Status: NEW → ASSIGNED

I did test this manually by visiting https://www.cbc.ca/news/politics/trudeau-covid19-premiers-address-1.5506473 during the live broadcast. This tests the no-controls case out of the box. I was able to test the controls case by running this in the console before clicking "play" on the video:

document.querySelectorAll("video").forEach(v => v.setAttribute("controls", true));
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/76b49244a016
Re-evaluate displaying the Picture-in-Picture toggle on durationchange video events. r=mstriemer
Blocks: 1624702
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
Flags: qe-verify+

I managed to reproduce the issue using an older version of Nightly (2020-03-16) on Windows 10 x64.
I retested everything using latest Nightly 77.0a1 and Firefox 76.0b4 on macOS 10.11, Ubuntu 18.04 x64 and Windows 10 x64. The issue is not reproducing anymore.

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