Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMedia fragment parser #23774
Media fragment parser #23774
Conversation
highfive
commented
Jul 15, 2019
|
Heads up! This PR modifies the following files:
|
|
Hey guys. There are some odd parts about the specification that I wanted to note as it relates to the changes in the PR. First, when a video track is added to the HTML media element the spec says:
When it describes the track as the first such track I assumed this to mean the video track at the zeroth index in the video track list but I can see how this could also mean if this track is the first such track with that specific media fragment. Second, I didn't include SMPTE for temporal fragments. I wasn't sure if Servo would use the frames portion of the fragment which is the only difference between SMPTE and NPT. This can be included rather easy if needed. Last, the spec for HTML media element is not clear on using the end time. I am thinking that somehow the duration could be set to the end time and the player would need to stop at that time. Or, the start and end time could be used to request only that portion of the resource. |
|
For real world clock time I followed RFC 2326 section 3.7. |
|
Beautiful work! |
| @@ -0,0 +1,39 @@ | |||
| <!doctype html> | |||
This comment has been minimized.
This comment has been minimized.
ferjm
Jul 18, 2019
Member
This is a nice test. I would move it to web-platform-tests/html/semantics/embedded-content/media-elements so it is pushed upstream.
This comment has been minimized.
This comment has been minimized.
ferjm
Jul 18, 2019
Member
FYI, there is also a very complete set of tests at https://www.w3.org/2008/WebVideo/Fragments/TC/ua-test-cases in case that you want to port some of them here.
This comment has been minimized.
This comment has been minimized.
sreeise
Jul 23, 2019
Author
Contributor
Ahh thats good. I incorporated some of those in the test case. I can add more if you would like or another test for invalid semantics.
This comment has been minimized.
This comment has been minimized.
| @@ -0,0 +1,355 @@ | |||
| /* This Source Code Form is subject to the terms of the Mozilla Public | |||
This comment has been minimized.
This comment has been minimized.
ferjm
Jul 18, 2019
Member
This can probably be tweaked a little bit (removing the DOMString dependency) so it can be published as a standalone crate. File a follow-up issue for this, please.
This comment has been minimized.
This comment has been minimized.
The former looks like a better option to me, as the latter likely depends on byte-range requests support. |
|
@bors-servo try=wpt |
Media fragment parser <!-- Please describe your changes on the following line: --> Media fragment parser for audio and video. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #22366 (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23774) <!-- Reviewable:end -->
|
|
|
Opened new PR for upstreamable changes. Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#17987. |
|
Thanks! |
|
|
Media fragment parser <!-- Please describe your changes on the following line: --> Media fragment parser for audio and video. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #22366 (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23774) <!-- Reviewable:end -->
|
|
| } | ||
|
|
||
| // Parse a full URL or a relative URL without a base retaining the query and/or fragment. | ||
| fn split_url(s: &str) -> (DOMString, DOMString) { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
sreeise
Jul 25, 2019
Author
Contributor
This is mostly for relative URL's which could be passed to the parser from HTMLMediaElement for the video/audio src. These may have a relative file location with a query or fragment such as: resources/video.mp4#t=10
sreeise commentedJul 15, 2019
•
edited by SimonSapin
Media fragment parser for audio and video.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is