Bug 1548923 - part2 : reset cues' active flag when media element's ready state becomes 'HAVE_NOTHING' r=jya
According to the spec [1], whenever the media element's readyState is changed back to `HAVE_NOTHING`, we have to reset all cues' active flag and update cue display in order to hide them. [1] https://html.spec.whatwg.org/multipage/media.html#text-track-cue-active-flag Differential Revision: https://phabricator.services.mozilla.com/D30110
This commit is contained in:
@@ -824,8 +824,14 @@ void TextTrackManager::NotifyCueUpdated(TextTrackCue* aCue) {
|
||||
}
|
||||
|
||||
void TextTrackManager::NotifyReset() {
|
||||
// https://html.spec.whatwg.org/multipage/media.html#text-track-cue-active-flag
|
||||
// This will unset all cues' active flag and update the cue display.
|
||||
WEBVTT_LOG("NotifyReset");
|
||||
mLastTimeMarchesOnCalled = media::TimeUnit::Zero();
|
||||
for (uint32_t idx = 0; idx < mTextTracks->Length(); ++idx) {
|
||||
(*mTextTracks)[idx]->SetCuesInactive();
|
||||
}
|
||||
UpdateCueDisplay();
|
||||
}
|
||||
|
||||
void TextTrackManager::ReportTelemetryForTrack(TextTrack* aTextTrack) const {
|
||||
|
||||
Reference in New Issue
Block a user