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:
alwu
2019-05-08 17:46:39 +00:00
parent e4fdf76357
commit 2e2df3569c
3 changed files with 17 additions and 5 deletions

View File

@@ -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 {