diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-04-22 14:44:33 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-04-23 16:22:45 +0200 |
commit | 9c940608fd75c9985acc3edc73937bd1b3e893ea (patch) | |
tree | 50f4169457e048e3e34e0b3c10298bc25fd548a4 /Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h | |
parent | 73a80b70473d15d715f527c41319753102520b7b (diff) | |
download | serenity-9c940608fd75c9985acc3edc73937bd1b3e893ea.zip |
LibWeb: Implement the HTMLMediaElement error attribute
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h index 5756414602..53b5694451 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h @@ -34,6 +34,8 @@ public: void queue_a_media_element_task(JS::SafeFunction<void()> steps); + JS::GCPtr<MediaError> error() const { return m_error; } + String const& current_src() const { return m_current_src; } enum class NetworkState : u16 { @@ -103,10 +105,10 @@ private: WebIDL::ExceptionOr<void> load_element(); WebIDL::ExceptionOr<void> select_resource(); - WebIDL::ExceptionOr<void> fetch_resource(AK::URL const&, Function<void()> failure_callback); + WebIDL::ExceptionOr<void> fetch_resource(AK::URL const&, Function<void(String)> failure_callback); static bool verify_response(JS::NonnullGCPtr<Fetch::Infrastructure::Response>, ByteRange const&); - WebIDL::ExceptionOr<void> process_media_data(Function<void()> failure_callback); - WebIDL::ExceptionOr<void> handle_media_source_failure(Span<JS::NonnullGCPtr<WebIDL::Promise>> promises); + WebIDL::ExceptionOr<void> process_media_data(Function<void(String)> failure_callback); + WebIDL::ExceptionOr<void> handle_media_source_failure(Span<JS::NonnullGCPtr<WebIDL::Promise>> promises, String error_message); void forget_media_resource_specific_tracks(); void set_ready_state(ReadyState); @@ -148,6 +150,9 @@ private: // 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-error + JS::GCPtr<MediaError> m_error; + // https://html.spec.whatwg.org/multipage/media.html#dom-media-crossorigin CORSSettingAttribute m_crossorigin { CORSSettingAttribute::NoCORS }; |