mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
LibWeb: Define steps to queue a media element task on a HTMLMediaElement
This commit is contained in:
parent
0a45554bf4
commit
9f8da9798a
2 changed files with 16 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/HTML/EventLoop/Task.h>
|
||||
#include <LibWeb/HTML/HTMLElement.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
@ -16,6 +17,8 @@ class HTMLMediaElement : public HTMLElement {
|
|||
public:
|
||||
virtual ~HTMLMediaElement() override;
|
||||
|
||||
void queue_a_media_element_task(JS::SafeFunction<void()> steps);
|
||||
|
||||
enum class NetworkState : u16 {
|
||||
Empty,
|
||||
Idle,
|
||||
|
@ -35,6 +38,11 @@ protected:
|
|||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
|
||||
private:
|
||||
Task::Source media_element_event_task_source() const { return m_media_element_event_task_source.source; }
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/media.html#media-element-event-task-source
|
||||
UniqueTaskSource m_media_element_event_task_source {};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/media.html#dom-media-networkstate
|
||||
NetworkState m_network_state { NetworkState::Empty };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue