mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:07:44 +00:00
LibWeb: Implement the :buffering
and :stalled
pseudo-classes
Currently, HTMLMediaElement doesn't implement the stall timeout, so `:stalled` always returns false.
This commit is contained in:
parent
eb7cda1172
commit
f6e4caf197
7 changed files with 42 additions and 2 deletions
|
@ -1273,7 +1273,10 @@ void HTMLMediaElement::forget_media_resource_specific_tracks()
|
|||
// https://html.spec.whatwg.org/multipage/media.html#ready-states:media-element-3
|
||||
void HTMLMediaElement::set_ready_state(ReadyState ready_state)
|
||||
{
|
||||
ScopeGuard guard { [&] { m_ready_state = ready_state; } };
|
||||
ScopeGuard guard { [&] {
|
||||
m_ready_state = ready_state;
|
||||
set_needs_style_update(true);
|
||||
} };
|
||||
|
||||
// When the ready state of a media element whose networkState is not NETWORK_EMPTY changes, the user agent must
|
||||
// follow the steps given below:
|
||||
|
@ -1624,6 +1627,12 @@ bool HTMLMediaElement::blocked() const
|
|||
return false;
|
||||
}
|
||||
|
||||
bool HTMLMediaElement::stalled() const
|
||||
{
|
||||
// FIXME: Implement stall timeout. https://html.spec.whatwg.org/multipage/media.html#stall-timeout
|
||||
return false;
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/media.html#potentially-playing
|
||||
bool HTMLMediaElement::potentially_playing() const
|
||||
{
|
||||
|
|
|
@ -68,6 +68,8 @@ public:
|
|||
HaveEnoughData,
|
||||
};
|
||||
ReadyState ready_state() const { return m_ready_state; }
|
||||
bool blocked() const;
|
||||
bool stalled() const;
|
||||
|
||||
bool seeking() const { return m_seeking; }
|
||||
void set_seeking(bool);
|
||||
|
@ -172,7 +174,6 @@ private:
|
|||
|
||||
void volume_or_muted_attribute_changed();
|
||||
|
||||
bool blocked() const;
|
||||
bool is_eligible_for_autoplay() const;
|
||||
bool has_ended_playback() const;
|
||||
WebIDL::ExceptionOr<void> reached_end_of_media_playback();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue