mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 17:44:58 +00:00
LibWeb: Set the media ready state to HAVE_ENOUGH_DATA after fetching
Because we currently both fetch and process the media data in one chunk, we have enough data for playback immediately.
This commit is contained in:
parent
90e1d4f545
commit
4f29cac715
1 changed files with 10 additions and 0 deletions
|
@ -503,6 +503,16 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::fetch_resource(AK::URL const& url_re
|
|||
|
||||
queue_a_media_element_task([this, failure_callback = move(failure_callback)]() mutable {
|
||||
process_media_data(move(failure_callback)).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
// NOTE: The spec does not say exactly when to update the readyState attribute. Rather, it describes what
|
||||
// each step requires, and leaves it up to the user agent to determine when those requirments are
|
||||
// reached: https://html.spec.whatwg.org/multipage/media.html#ready-states
|
||||
//
|
||||
// Since we fetch the entire response at once, if we reach here with successfully decoded video
|
||||
// metadata, we have satisfied the HAVE_ENOUGH_DATA requirements. This logic will of course need
|
||||
// to change if we fetch or process the media data in smaller chunks.
|
||||
if (m_ready_state == ReadyState::HaveMetadata)
|
||||
set_ready_state(ReadyState::HaveEnoughData);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue