mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibMedia+LibWeb: Implement media volume/muting
This commit is contained in:
committed by
Jelle Raaijmakers
parent
e176249db8
commit
8d9a493b1b
Notes:
github-actions[bot]
2025-10-28 00:34:20 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/8d9a493b1b3 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6410 Reviewed-by: https://github.com/R-Goc Reviewed-by: https://github.com/gmta ✅
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user