Closed Bug 1634494 Opened 5 years ago Closed 5 years ago

Calling default action handler for `pause/stop` on those windows which doesn't have active action handlers or its media session is not active

Categories

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

task

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

Details

Attachments

(8 files, 2 obsolete files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

Fork from bug1633565 comment1, within a page, we should treat each frame differently and call the default action handler for pause and stop if that frame doesn't have active media session or the active media session doesn't have a handler for pause or stop.

Summary: Calling default action handler for `pause/stop` on those windows which doesn't have active action handlers → Calling default action handler for `pause/stop` on those windows which doesn't have active action handlers or its media session is not active

We determine which media session is active media session in chrome process, but the media session in content process doesn't know the detail.

This patch would store the active session context Id on the top level WindowContext, so that media session in content process can know if it's an active context or not, which helps to trigger the action handler only on active media session, after changing our propagation mechanism in following patches.

Attachment #9170128 - Attachment is obsolete: true

play default handler is a special case, we don't want to run it arbitrarily in order to get a better user experience.

If we have an active media session, the play should only be triggered on that session, which is something a user really wants to resume. Therefore, adding some restrictions to call default play handler only when

(1) We don't have an active media session (If we have one, the play action handler should only be triggered on that session)
(2) Active media session without setting action handler for play

Attachment #9170132 - Attachment is obsolete: true
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/68883ad72bf2 part1 : store the active media session context Id on WindowContext. r=chunmin,farre https://hg.mozilla.org/integration/autoland/rev/a29128465e05 part2 : only call action handler on active media session. r=chunmin https://hg.mozilla.org/integration/autoland/rev/4df5c6612e88 part3 : make content media controller per inner window. r=chunmin,smaug https://hg.mozilla.org/integration/autoland/rev/5560c478b424 part4 : notify media control action to the top level browsing context and all its children. r=chunmin https://hg.mozilla.org/integration/autoland/rev/a5f8ee649ac8 part5 : not always call `play` default handler r=chunmin https://hg.mozilla.org/integration/autoland/rev/fd7852d71376 part6 : abort if we don't have any receiver. r=chunmin https://hg.mozilla.org/integration/autoland/rev/d8b735f11b4b part7 : merge 'file_media_session_page.html' to 'file_iframe_media.html'. r=chunmin https://hg.mozilla.org/integration/autoland/rev/e1cf0bdac6b6 part8 : add test r=chunmin
Regressions: 1661557
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: