This makes it more clear what part of the code is triggering the ReadyState
to be what it is. I.E. Tracks added through the HTMLMediaElement::AddTextTrack
method should have a ReadyState of "Loaded" and so it's more clear for
function to specify that. Vice versa for TrackElements which add TextTracks
with a default ReadyState of "None".
- This allows us to pass around ReadyState values. It also makes the type
explicit which will save us from potentially shooting ourselves in
the foot.
- I also renamed 'READY_STATE_NONE' and 'READY_STATE_ERROR' to
'NotLoaded' and 'FailedToLoad' respectively in the enum. This is to
avoid some name collision errors we were having. It also makes it more
clear where in the spec this is as these names are the spec's names
for the TextTrack enum.
This makes more sense as the READY_STATE values in the spec are always
referred to be 'text track readiness states' not HTMLTrackElement
readiness states.
- I've refactored the way we set modes as well, making it a part
of the TextTrack ctors.
- I've also changed TextTracks in the track tests to have their
mode set to 'hidden' in order to be able to call TextTrack::Cues.
This is correct since TextTracks with a mode of 'disabled' do not
return null for their cue lists.
- This implements sorting on the MediaElement's list of TextTracks as
described in: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-model
This is important as automatically positioned cues will have a line
position that is relative to their TextTrack's position in the
MediaElement's list of TextTracks.
- Added a TextTrackSource enum which all TextTracks have. This helps
distinguish where a TextTrack came from.
- These two parts of the spec were recently removed as they
were seen as unecessary or bad design, in the case of the
VTTRegion TextTrack extensions. See the spec bug at:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=24380
Change the way they store references to eachother to make more sense.
A Track will never belong to a MediaElement directly. It will always
belong to one through a TextTrackList.
Our JS WebVTT implementation (vtt.js) needs access to the Track's
TextTrackList in order to compute the line position of a TextTrackCue.
Therefore, we need to expose it to chrome JS so that vtt.js can have
access to it.
- Active cues now returns the subset of cues in mCueList that are valid
for the current playback time.
- Introduces new code in media element, when seeking, and in TextTrack, when
adding and removing cues, to mark the active cue list as dirty so that we know
when we might need to rebuild the list completely.
- Updated RemoveCue to throw NotFoundError if the cue being removed is
not in the cue list.
- Updated AddCue to not add cues that are already in the list. This is
done by reference comparing.
We were incorrectly using the wrapper cache cycle collection macros when that
functionality was already implemented by the base classes. Therefore, we
should instead use the inherited version of the cycle collection macros.
- Implemented WebVTTLoadListener to manage the webvtt parser.
- TextTrackCue now handles the conversion of webvtt nodes to
anonymous content which will be displayed on the video div
overlay.
- HTMLTrackElement manages the lifetime of the WebVTTLoadListener.
Add webidl interfaces and implementations of the HTML <track>
element and related TextTrack, TextTrackList, TextTrackCue,
and TextTrackCueList dom objects.
Visibility is controlled by the media.webvtt.enabled pref,
which defaults to false.
HTMLMediaElement:NewURIFromString() is hoisted to
nsGenericHTMLElement so it's available to the track
element as well.
This patch is primarily work by Dale Karp, David Humphrey
and others as Seneca College.