Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/js/tracks/audio-track-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const disableOthers = function(list, track) {
* The current list of {@link AudioTrack} for a media file.
*
* @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist}
* @extends TrackList
* @extends TrackList<AudioTrack>
*/
class AudioTrackList extends TrackList {

Expand Down
2 changes: 1 addition & 1 deletion src/js/tracks/text-track-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import TrackList from './track-list';
* The current list of {@link TextTrack} for a media file.
*
* @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttracklist}
* @extends TrackList
* @extends TrackList<TextTrack>
*/
class TextTrackList extends TrackList {

Expand Down
13 changes: 9 additions & 4 deletions src/js/tracks/track-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,25 @@ import {isEvented} from '../mixins/evented';
* Common functionaliy between {@link TextTrackList}, {@link AudioTrackList}, and
* {@link VideoTrackList}
*
* @template [T=Track] extends Track
* @extends EventTarget
*/
class TrackList extends EventTarget {
/**
* Create an instance of this class
*
* @param { Track[] } tracks
* @param { T[] } tracks
* A list of tracks to initialize the list with.
*
* @abstract
*/
constructor(tracks = []) {
super();

/**
* @type {T[]} tracks_
* The list of tracks.
*/
this.tracks_ = [];

/**
Expand All @@ -46,7 +51,7 @@ class TrackList extends EventTarget {
/**
* Add a {@link Track} to the `TrackList`
*
* @param {Track} track
* @param {T} track
* The audio, video, or text track to add to the list.
*
* @fires TrackList#addtrack
Expand Down Expand Up @@ -104,7 +109,7 @@ class TrackList extends EventTarget {
/**
* Remove a {@link Track} from the `TrackList`
*
* @param {Track} rtrack
* @param {T} rtrack
* The audio, video, or text track to remove from the list.
*
* @fires TrackList#removetrack
Expand Down Expand Up @@ -134,7 +139,7 @@ class TrackList extends EventTarget {
*
* @event TrackList#removetrack
* @type {Event}
* @property {Track} track
* @property {T} track
* A reference to track that was removed.
*/
this.trigger({
Expand Down
2 changes: 1 addition & 1 deletion src/js/tracks/video-track-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const disableOthers = function(list, track) {
* The current list of {@link VideoTrack} for a video.
*
* @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist}
* @extends TrackList
* @extends TrackList<VideoTrack>
*/
class VideoTrackList extends TrackList {

Expand Down