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 upMake media tracks aware of their associated track list #22912
Comments
|
@moonlightdrive This might be a good first issue! |
|
Thanks @jdm! I'll take a look at this one |
Integrates media track selection <!-- Please describe your changes on the following line: --> Updates audio/video track selection to use the servo media player track selection methods. This is technically only a partial fix because only one audio track can be set at a time and servo_media needs to be updated to handle multiple audio tracks. Once/if this goes through I can file follow up issue for that. I believe this also inadvertently covers at least some of #22912 --- <!-- 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 #22799 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because - This probably should have a test case. But I am not aware of a way, at least not from servo, to test that the actual audio or video changed in the underlying player or on screen. <!-- 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/24265) <!-- Reviewable:end -->
|
@jdm what changes are still required here? I see that the required member has been defined but without the DomRefCell wrapper |
|
@kunalmohan I believe we still need the DomRefCell so that the associated track list can be updated when it's added or removed. That's the work that still needs to happen here. |
|
Okay. I'll start working on this issue. |
|
I am a bit confused here so I just want to confirm I am thinking in the right direction here. I will have to update the servo/components/script/dom/audiotracklist.rs Lines 105 to 107 in bac9903 I don't see any function that removes a track from a tracklist, so what about updating it during removal of track object? |
|
servo/components/script/dom/audiotracklist.rs Lines 109 to 111 in bac9903 Also, as part of this work we should implement the setting behaviour from https://html.spec.whatwg.org/multipage/media.html#dom-videotrack-selected, which is the motivation for this issue. |
|
And to explicitly answer your question: yes. |
|
texttracklist.rs does not have a clear() function, but has the following function: servo/components/script/dom/texttracklist.rs Lines 100 to 109 in bb5cd02 Is there a need for clear() function here or should I proceed with the current code? |
I think the setting behaviour is already implemented here. servo/components/script/dom/videotracklist.rs Lines 73 to 107 in bb5cd02 Or is there something that need to be implemented yet? Sorry for troubling you with so many questions Thanks for the help |
|
The setting that I was describing is implemented in servo/components/script/dom/videotrack.rs Lines 104 to 112 in bb5cd02 |
|
Yeah, that makes sense. So, on clearing a tracklist member I have updated the |
What about this? |
|
The |
Add `track_list` member to AudioTrack, VideoTrack, TextTrack structs Add member to the track structs pointing at their associated tracklist and update it when the track is added or removed from a tracklist. r?@jdm <!-- Please describe your changes on the following line: --> --- <!-- 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 #22912 (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes <!-- 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. -->
Per #22622 (comment) the AudioTrack, VideoTrack, and TextTrack interfaces will need to store a member pointing at the track list object that they are associated with. This will look something like
DomRefCell<Option<Dom<AudioTrackList>>>and it will be updated when the track object is added to a list or removed from one.Code:
components/script/dom/audiotrack.rs,components/script/dom/videotrack.rs,components/texttrack.rsTests:
./mach test-wpt tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/