LibWeb: Update the ready state after enabling tracks

Otherwise, the buffered ranges used won't include the tracks that are
supposed to be enabled.
This commit is contained in:
Zaggy1024 2026-04-03 16:46:18 -05:00 committed by Gregory Bertilson
parent c8382bb465
commit bece3c360d
Notes: github-actions[bot] 2026-04-10 20:22:25 +00:00

View file

@ -1705,9 +1705,6 @@ void HTMLMediaElement::on_metadata_parsed()
// 6. Set the readyState attribute to HAVE_METADATA.
set_ready_state(ReadyState::HaveMetadata);
// AD-HOC: If we've already got buffered data, we need to upgrade the readyState further than HAVE_METADATA.
update_ready_state();
// 7. Let jumped be false.
[[maybe_unused]] auto jumped = false;
@ -1739,6 +1736,9 @@ void HTMLMediaElement::on_metadata_parsed()
return IterationDecision::Break;
});
}
// AD-HOC: If we've already got buffered data, we need to upgrade the readyState further than HAVE_METADATA.
update_ready_state();
}
// https://html.spec.whatwg.org/multipage/media.html#media-data-processing-steps-list