From 6f65566a1af9a016eb85d427df16cc4228d003f0 Mon Sep 17 00:00:00 2001 From: Colin Liang Date: Mon, 25 Mar 2024 16:50:51 -0700 Subject: [PATCH] Don't raise error in HTMLMediaElement.h5vccAudioConnectors (#2687) b/330929788 Co-authored-by: Colin Liang (cherry picked from commit cb7bc136737220da7170f3e47c7eb8b63068017e) --- cobalt/dom/html_media_element.cc | 10 +++------- cobalt/dom/html_media_element.h | 3 +-- cobalt/dom/html_media_element.idl | 5 ++--- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/cobalt/dom/html_media_element.cc b/cobalt/dom/html_media_element.cc index 054209f35612..45996b16203c 100644 --- a/cobalt/dom/html_media_element.cc +++ b/cobalt/dom/html_media_element.cc @@ -33,6 +33,8 @@ #include "cobalt/base/tokens.h" #include "cobalt/cssom/map_to_mesh_function.h" #include "cobalt/dom/document.h" +#include "cobalt/dom/eme/media_encrypted_event.h" +#include "cobalt/dom/eme/media_encrypted_event_init.h" #include "cobalt/dom/html_element_context.h" #include "cobalt/dom/html_video_element.h" #include "cobalt/dom/media_settings.h" @@ -50,9 +52,6 @@ #include "cobalt/web/web_settings.h" #include "starboard/system.h" -#include "cobalt/dom/eme/media_encrypted_event.h" -#include "cobalt/dom/eme/media_encrypted_event_init.h" - namespace cobalt { namespace dom { @@ -645,16 +644,13 @@ void HTMLMediaElement::ScheduleEvent(const scoped_refptr& event) { event_queue_.Enqueue(event); } -std::string HTMLMediaElement::h5vcc_audio_connectors( - script::ExceptionState* exception_state) const { +std::string HTMLMediaElement::h5vcc_audio_connectors() const { static const CobaltExtensionConfigurableAudioWriteAheadApi* extension_api = static_cast( SbSystemGetExtension( kCobaltExtensionConfigurableAudioWriteAheadName)); if (extension_api) { if (!player_) { - web::DOMException::Raise(web::DOMException::kInvalidStateErr, - exception_state); return std::string(); } diff --git a/cobalt/dom/html_media_element.h b/cobalt/dom/html_media_element.h index 612e21cf20bc..46ca3c8271cc 100644 --- a/cobalt/dom/html_media_element.h +++ b/cobalt/dom/html_media_element.h @@ -149,8 +149,7 @@ class HTMLMediaElement : public HTMLElement, // Returns semicolon separated names of audio connectors, like // "hdmi;bluetooth". // TODO(b/267678497): The current interface is tentative, to be refined. - std::string h5vcc_audio_connectors( - script::ExceptionState* exception_state) const; + std::string h5vcc_audio_connectors() const; // Set max video capabilities. void SetMaxVideoCapabilities(const std::string& max_video_capabilities, diff --git a/cobalt/dom/html_media_element.idl b/cobalt/dom/html_media_element.idl index 401060a6f7b7..f3b79173e6c6 100644 --- a/cobalt/dom/html_media_element.idl +++ b/cobalt/dom/html_media_element.idl @@ -63,8 +63,7 @@ interface HTMLMediaElement : HTMLElement { attribute boolean muted; // non standard, semicolon separated names of audio connectors, like - // "hdmi;bluetooth". It raises `NotSupportedError` on apps doesn't support - // this feature, or `InvalidStateError` if there isn't an active playback. + // "hdmi;bluetooth". // TODO(b/267678497): The current interface is tentative, to be refined. - [RaisesException] readonly attribute DOMString h5vccAudioConnectors; + readonly attribute DOMString h5vccAudioConnectors; };