-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No video.removeTextTrack method #1921
Comments
@zcorpan, any thoughts on this, or ideas on which browser implementers to contact to gain interest? |
The proposal sounds reasonable to me. |
The proposal sounds reasonable to me as well. |
I believe this should be pretty easy to implement, so if it helps people trying to do custom captions, let's do it. @egreaves, would you be willing to start by writing tests in web-platform-tests for how this should work? It would be in html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/removeTextTrack.html The only interesting question I think is what happens when you try to remove a TextTrack object that comes from a track element or from in-band tracks. One could make it do something sensible, like removing the track element itself and forgetting the in-band track, or throw an exception. Preferences? |
@foolip, sure - I can undertake that. Re: your questions...
|
Do you mean the fact that removing the track element from the document also removes the TextTrack object from the media element's |
I think the symmetrical behavior for removing the track element vs track object on the |
Is anyone willing to drive this? I've changed the labels around a bit to reflect the fact that this is waiting for tests (and then spec PR) and not so much implementor interest anymore. |
Is submitted a PR to add tests to the web platform tests the next step to move this along? |
Yes, even if we're not exactly sure of the right behavior and wouldn't merge it yet, I think that's a good way to discuss the precise behavior intended. |
(One would be right to point out that writing tests with no implementation is error-prone, but the only alternative here is for an implementer to volunteer to implement and write tests at the same time.) |
It happened! web-platform-tests/wpt#6594 |
I could try but not really sure where to start with making spec text changes. |
I've fleshed out the general structure of this in #2881, but there's a TODO about in-band tracks that I haven't thought much about yet. Still, review on the general shape of that would be appreciated. |
I did mostly-editorial review. @gkatsev thoughts on the in-band tracks case? Did you test that? |
The spec and test change is sitting idle in review now. @gkatsev, are you interested in taking over to complete the work? |
Yes, I'd be very interested. Also, sorry I haven't replied got busy with other work. |
@gkatsev, great! The main thing that needs doing now is to address the comments and TODOs in #2881, and then make sure that web-platform-tests/wpt#6594 matches what the spec ends up saying. |
I have abandoned #2881. If someone would like to help fix this, preparing a new pull request for the spec and a pull request like web-platform-tests/wpt#6594 is what it would take. |
The
addTextTrack
method can be used to add text tracks to a video element, but there is noremoveTextTrack
method, though the TextTrackList interface has anonremovetrack
handler.There are two use cases for the
addTextTrack
method in lieu of appending atrack
element:HTMLMediaElement.src
.The only way to remove textTracks created via
addTextTrack
is to destroy the video element, which has adverse side effects for playback of playlist content.To date, most video players have opted to create their own text track management solutions. There are multiple implementations where a single track is used and
VTTCues
are cleared/replaced whenever the user switches captions/subtitles tracks. However, this approach falls apart on iOS devices where there's a need to rely on native controls in fullscreen.Adding support for this method would get video players closer to being able to rely on browsers for text track management.
The text was updated successfully, but these errors were encountered: