зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1550633 - part2 : maybe start loading resource when the track's mode changes. r=jya
According to the spec [1], the user agent must start the track processing model when text track has its text track mode changed. [1] https://html.spec.whatwg.org/multipage/media.html#sourcing-out-of-band-text-tracks:start-the-track-processing-model Differential Revision: https://phabricator.services.mozilla.com/D31372 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
7ba57e42c0
Коммит
47597aeb6b
|
@ -256,6 +256,11 @@ void HTMLTrackElement::MaybeDispatchLoadResource() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (ReadyState() == TextTrackReadyState::Loaded) {
|
||||
LOG(LogLevel::Info, ("%p Has already loaded resource", this));
|
||||
return;
|
||||
}
|
||||
|
||||
// step5, await a stable state and run the rest of steps.
|
||||
if (!mLoadResourceDispatched) {
|
||||
RefPtr<WebVTTListener> listener = new WebVTTListener(this);
|
||||
|
|
|
@ -129,6 +129,12 @@ void TextTrack::SetMode(TextTrackMode aValue) {
|
|||
if (mediaElement) {
|
||||
mediaElement->NotifyTextTrackModeChanged();
|
||||
}
|
||||
// https://html.spec.whatwg.org/multipage/media.html#sourcing-out-of-band-text-tracks:start-the-track-processing-model
|
||||
// Run the `start-the-track-processing-model` to track's corresponding track
|
||||
// element whenever track's mode changes.
|
||||
if (mTrackElement) {
|
||||
mTrackElement->MaybeDispatchLoadResource();
|
||||
}
|
||||
// Ensure the TimeMarchesOn is called in case that the mCueList
|
||||
// is empty.
|
||||
NotifyCueUpdated(nullptr);
|
||||
|
|
Загрузка…
Ссылка в новой задаче