Closed Bug 1654959 Opened 4 years ago Closed 4 years ago

Start the listener when media enters fullscreen or PIP mode

Categories

(Core :: Audio/Video: Playback, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

Details

Attachments

(3 files)

Per bug 1653390 comment12, move PIP and fullscreen related changes to this bug.

This bug would force media element to start the listener when it enters PIP or fullscreen mode.

Add two new test cases for inaudible media being used in fullscreen/PIP mode.

In addition, after applying D84115, we fix the issue of incorrectly controlling media which doesn't be started yet and is not in the fullscreen. So modify the current test case.

When a media enters PIP mode, we should consider it as an important one which user might want to control. Therefore, start the listener in order to notify the media has been started, then we would update the PIP state [1] which would activate the controller.

As the PIP state changes can happen after Stop() is called, so in this patch, we would remove the start check and reset mControlAgent in Stop() in order to update PIP state after the listener stops. Eg. Reset the PIP video's src, then cancel the PIP.

[1] https://searchfox.org/mozilla-central/rev/9b282b34b5aa0f836beb735656c55efb2cc4c617/dom/html/HTMLMediaElement.cpp#7902

When a media enters fullscreen mode, we should consider it as an important one which user might want to control. Therefore, start the listener in order to notify the media has been started, then we would update the fullscreen state [1] which would activate the controller.

[1] https://searchfox.org/mozilla-central/rev/9b282b34b5aa0f836beb735656c55efb2cc4c617/dom/base/Document.cpp#13429

Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4e685f4aa90e part1 : start listener when media enters fullscreen. r=bryce https://hg.mozilla.org/integration/autoland/rev/f10c1afc8bf0 part2 : start listener when media enters PIP mode. r=bryce https://hg.mozilla.org/integration/autoland/rev/77366f40af71 part3 : add test cases for enabling muted media into fullscreen/PIP mode. r=bryce
Regressions: 1655175
No longer regressions: 1655175
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: