1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

LibWeb: Implement the HTMLMediaElement error attribute

This commit is contained in:
Timothy Flynn 2023-04-22 14:44:33 -04:00 committed by Andreas Kling
parent 73a80b7047
commit 9c940608fd
3 changed files with 39 additions and 19 deletions

View file

@ -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 };