Skip to content

Commit

Permalink
Change h5vccAudioConnectors attribute in html_media_element.idl
Browse files Browse the repository at this point in the history
b/330929788
  • Loading branch information
Colin Liang committed Mar 22, 2024
1 parent 62f49e9 commit bf17afe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
11 changes: 3 additions & 8 deletions cobalt/dom/html_media_element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -642,21 +642,16 @@ void HTMLMediaElement::ScheduleEvent(const scoped_refptr<web::Event>& event) {
event_queue_.Enqueue(event);
}

std::string HTMLMediaElement::h5vcc_audio_connectors(
script::ExceptionState* exception_state) const {
std::string HTMLMediaElement::h5vcc_audio_connectors() const {

Check warning on line 645 in cobalt/dom/html_media_element.cc

View check run for this annotation

Codecov / codecov/patch

cobalt/dom/html_media_element.cc#L645

Added line #L645 was not covered by tests
#if SB_API_VERSION >= 15
if (!player_) {
web::DOMException::Raise(web::DOMException::kInvalidStateErr,
exception_state);
return std::string();
return "NOT_SUPPORTED";

Check warning on line 648 in cobalt/dom/html_media_element.cc

View check run for this annotation

Codecov / codecov/patch

cobalt/dom/html_media_element.cc#L648

Added line #L648 was not covered by tests
}

std::vector<std::string> configs = player_->GetAudioConnectors();
return base::JoinString(configs, ";");
#else // SB_API_VERSION >= 15
web::DOMException::Raise(web::DOMException::kNotSupportedErr,
exception_state);
return std::string();
return "NOT_SUPPORTED";
#endif // SB_API_VERSION >= 15
}

Expand Down
3 changes: 1 addition & 2 deletions cobalt/dom/html_media_element.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion cobalt/dom/html_media_element.idl
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ interface HTMLMediaElement : HTMLElement {
// "hdmi;bluetooth". It raises `NotSupportedError` on apps doesn't support
// this feature, or `InvalidStateError` if there isn't an active playback.
// TODO(b/267678497): The current interface is tentative, to be refined.
[RaisesException] readonly attribute DOMString h5vccAudioConnectors;
readonly attribute DOMString h5vccAudioConnectors;
};

0 comments on commit bf17afe

Please sign in to comment.