Closed Bug 1836128 Opened 9 months ago Closed 5 months ago

Implement <source media> for media elements

Categories

(Core :: Audio/Video: Playback, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: zcorpan, Assigned: scottjehl)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

Component: Audio/Video → Audio/Video: Playback

Hi! I wanted to check in on this issue and see if any additional research (or demo work) would be helpful to facilitate getting this feature re-introduced? Thanks!

No, it's just that it's in our backlog for now.

Thanks Paul. That makes sense!

I've taken a stab at re-implementing this myself in Nightly and it seems to be working as expected. I'll aim to submit it for review as soon as I figure out how and where to wire up the tests.

We have some tests already, merged in https://github.com/web-platform-tests/wpt/pull/40330

To run them, you can run (from a source dir) e.g.:

./mach wpt html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-source-media-env-change.html

and the same by substituting the path to the other tests (you can also specify multiple paths iirc).

It should run the browser, and run some stuff, and then say something like:

 0:25.62 TEST_START: /html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-source-media-env-change.html
...
...
 0:26.35 TEST_END: Test FAIL. Subtests passed 1/1. Unexpected 1

at which point the test is passing, but we expected it to fail. To remove this expectation (so that it's expected to pass), you can remove e.g. this file:

https://searchfox.org/mozilla-central/source/testing/web-platform/meta/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-source-media-env-change.html.ini

same goes for the other test in the WPT PR of course. If you upload a patch containing all this, I can push it to our CI so that all tests are going to run, and we'll see if we need to modify more things.

The test themselves are at https://searchfox.org/mozilla-central/source/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-source-media-env-change.html in our source dir. If you need to modify them, or test more things, you can simply modify this file and the modifications will be auto-synchronized to the upstream copy.

Flags: needinfo?(scottjehl)

That's so helpful, thank you. I'm going to read this a couple of times before digging back in :)

Flags: needinfo?(scottjehl)
Assignee: nobody → scottjehl
Status: NEW → ASSIGNED

Okay, I think I did the commit and review steps properly but many parts here are new to me so it's possible I messed something up!
https://phabricator.services.mozilla.com/D189416

I've reused the original commit's code aside from a small change to account for the passed param types.
Happy to take any direction you have from here.

Thank you for all the advice so far!

Pushed by padenot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/be242aef4fab
Implement source media for media elements and reference/update relevant platform tests r=padenot
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/42311 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
Upstream PR merged by moz-wptsync-bot
Regressions: 1841432
Keywords: dev-doc-needed

MDN doc updates for this change can be tracked through this GitHub issue: https://github.com/mdn/content/issues/29788

You need to log in before you can comment on or make changes to this bug.