mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-23 02:31:55 +00:00
LibWeb+LibWebView+WebContent: Support muting an entire page
This adds an IPC for chromes to mute a tab. When muted, we trigger an internal volume change notification and indicate that the user agent has overriden the media volume.
This commit is contained in:
parent
7c31343df0
commit
f61f55d397
Notes:
sideshowbarker
2024-07-17 02:22:23 +09:00
Author: https://github.com/trflynn89
Commit: f61f55d397
Pull-request: https://github.com/SerenityOS/serenity/pull/23773
10 changed files with 68 additions and 2 deletions
|
@ -438,11 +438,18 @@ void HTMLMediaElement::volume_or_muted_attribute_changed()
|
|||
on_volume_change();
|
||||
}
|
||||
|
||||
void HTMLMediaElement::page_mute_state_changed(Badge<Page>)
|
||||
{
|
||||
on_volume_change();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/media.html#effective-media-volume
|
||||
double HTMLMediaElement::effective_media_volume() const
|
||||
{
|
||||
// FIXME 1. If the user has indicated that the user agent is to override the volume of the element, then return the
|
||||
// volume desired by the user.
|
||||
// 1. If the user has indicated that the user agent is to override the volume of the element, then return the
|
||||
// volume desired by the user.
|
||||
if (document().page().page_mute_state() == MuteState::Muted)
|
||||
return 0.0;
|
||||
|
||||
// 2. If the element's audio output is muted, then return zero.
|
||||
if (m_muted)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue