mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 03:29:49 +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
|
@ -6,6 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Assertions.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
enum class AudioPlayState {
|
||||
|
@ -13,4 +15,21 @@ enum class AudioPlayState {
|
|||
Playing,
|
||||
};
|
||||
|
||||
enum class MuteState {
|
||||
Muted,
|
||||
Unmuted,
|
||||
};
|
||||
|
||||
constexpr MuteState invert_mute_state(MuteState mute_state)
|
||||
{
|
||||
switch (mute_state) {
|
||||
case MuteState::Muted:
|
||||
return MuteState::Unmuted;
|
||||
case MuteState::Unmuted:
|
||||
return MuteState::Muted;
|
||||
}
|
||||
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue