From e9a3c41cdb93fb76efc98bf77ffec1e287d69847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= Date: Tue, 1 Aug 2017 11:56:49 +0200 Subject: [PATCH] Add video.removeTextTrack() method Fixes https://github.com/whatwg/html/issues/1921 Tests: https://github.com/w3c/web-platform-tests/pull/6594 --- source | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/source b/source index 7252a8c73e8..35150e0709a 100644 --- a/source +++ b/source @@ -32028,6 +32028,7 @@ interface HTMLMediaElement : HTMLElement { [SameObject] readonly attribute VideoTrackList videoTracks; [SameObject] readonly attribute TextTrackList textTracks; TextTrack addTextTrack(TextTrackKind kind, optional DOMString label = "", optional DOMString language = ""); + void removeTextTrack(TextTrack textTrack); };

The media element attributes, src, TextTrack : EventTarget { +

media . removeTextTrack( textTrack )
+
+ +

Removes a TODO.

+ +
+
textTrack . kind
@@ -36864,6 +36872,41 @@ interface TextTrack : EventTarget {
+

The removeTextTrack(textTrack) method of + media elements, when invoked, must run the following + steps:

+ +
    +
  1. If textTrack is not in the media element's list of text + tracks, then throw a "NotFoundError" DOMException + and abort these steps.

  2. + +
  3. +

    If textTrack has a corresponding track element, then remove that track element and abort these + steps.

    + +

    This will cause textTrack to be removed from the media + element's list of text tracks and a removetrack event to be fired.

    +
  4. + +
  5. If textTrack is a media-resource-specific text track, then + TODO.

  6. + +
  7. Remove textTrack from the media element's list of text + tracks.

  8. + +
  9. Queue a task to fire an event named + removetrack at the media element's + textTracks attribute's TextTrackList + object, using TrackEvent, with the track + attribute initialized to textTrack.

  10. +
+ +
+

The kind attribute must return the text track kind of the text track that the TextTrack object represents.