mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibMedia+LibWeb: Implement media volume/muting
This commit is contained in:
parent
e176249db8
commit
8d9a493b1b
Notes:
github-actions[bot]
2025-10-28 00:34:20 +00:00
Author: https://github.com/Zaggy1024
Commit: 8d9a493b1b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6410
Reviewed-by: https://github.com/R-Goc
Reviewed-by: https://github.com/gmta ✅
6 changed files with 34 additions and 2 deletions
|
|
@ -454,12 +454,12 @@ void HTMLMediaElement::volume_or_muted_attribute_changed()
|
|||
if (auto* paintable = this->paintable())
|
||||
paintable->set_needs_display();
|
||||
|
||||
// FIXME: Set the volume on the PlaybackManager.
|
||||
update_volume();
|
||||
}
|
||||
|
||||
void HTMLMediaElement::page_mute_state_changed(Badge<Page>)
|
||||
{
|
||||
// FIXME: Set the volume on the PlaybackManager.
|
||||
update_volume();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/media.html#effective-media-volume
|
||||
|
|
@ -484,6 +484,12 @@ double HTMLMediaElement::effective_media_volume() const
|
|||
return volume;
|
||||
}
|
||||
|
||||
void HTMLMediaElement::update_volume()
|
||||
{
|
||||
if (m_playback_manager)
|
||||
m_playback_manager->set_volume(effective_media_volume());
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/media.html#dom-media-addtexttrack
|
||||
GC::Ref<TextTrack> HTMLMediaElement::add_text_track(Bindings::TextTrackKind kind, String const& label, String const& language)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue