Bug 1548923 - part1 : abort 'TimeMarchesOn' algorithm during seeking. r=jya

In the spec [1], it doesn't mention that we should only run `TimeMarchesOn` after media has started. Therefore, we should remove this return condition in order to update cue's state correctly no matter the media starts or not.

In addition, according to the spec [2], `TimeMarchesOn` should be executed after seeking completed, we shouldn't not run it during seeking.

[1] https://html.spec.whatwg.org/multipage/media.html#time-marches-on
[2] https://html.spec.whatwg.org/multipage/media.html#seeking:time-marches-on

Differential Revision: https://phabricator.services.mozilla.com/D29882
This commit is contained in:
alwu
2019-05-08 17:33:36 +00:00
parent 4470605646
commit e4fdf76357

View File

@@ -620,7 +620,8 @@ void TextTrackManager::TimeMarchesOn() {
WEBVTT_LOG("TimeMarchesOn");
// Early return if we don't have any TextTracks or shutting down.
if (!mTextTracks || mTextTracks->Length() == 0 || IsShutdown()) {
if (!mTextTracks || mTextTracks->Length() == 0 || IsShutdown() ||
!mMediaElement) {
return;
}
@@ -630,9 +631,8 @@ void TextTrackManager::TimeMarchesOn() {
}
nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(parentObject);
if (mMediaElement &&
(!(mMediaElement->GetPlayedOrSeeked()) || mMediaElement->Seeking())) {
WEBVTT_LOG("TimeMarchesOn seeking or post return");
if (mMediaElement->Seeking()) {
WEBVTT_LOG("TimeMarchesOn return during seeking");
return;
}