Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-engine

Source of release 0.6.0

0.6.0 / src / web / html / media_error.lucb

#==============================================================================================
#
#   media_error - HTML::MediaError, why a media element failed
#
#   DESCRIPTION:
#       Port of Libraries/LibWeb/HTML/MediaError.cpp (lines 1-29) and the accessors of
#       MediaError.h.
#
#       Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
#       Copyright (c) 2026 the luce-browser authors.
#       SPDX-License-Identifier: BSD-2-Clause
#
#==============================================================================================

## Ported from MediaError.cpp:16 Web::HTML::MediaError::MediaError.
pub func html_media_error_construct(this: HtmlMediaError*, realm: Realm*, code: HtmlMediaErrorCode, message: ak.String):
    bind_platform_object_construct_realm(this.bind_platform_object(), realm)
    this.m_code = code
    this.m_message = message

## Ported from MediaError.cpp:23 Web::HTML::MediaError::initialize (override).
pub func html_media_error_initialize_impl(base: JsCell*, realm: Realm*):
    web_set_prototype_for_interface(base, realm, BindInterfaceName.media_error)
    # Base::initialize(realm): PlatformObject inherits JS::Object's.
    js_cell_initialize_impl(base, realm)

## MediaError has no visit_edges of its own (PlatformObject's).
pub func html_media_error_visit_edges_impl(base: gc.Cell*, visitor: gc.CellVisitor*):
    bind_platform_object_visit_edges_impl(base, visitor)

## Ported from MediaError.h:27 Web::HTML::MediaError::code.
pub func html_media_error_code(this: HtmlMediaError*) -> HtmlMediaErrorCode:
    return this.m_code

## Ported from MediaError.h:28 Web::HTML::MediaError::message.
pub func html_media_error_message(this: HtmlMediaError*) -> ak.String:
    return this.m_message