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:
Timothy Flynn 2024-03-30 09:41:15 -04:00 committed by Andreas Kling
commit f61f55d397
Notes: sideshowbarker 2024-07-17 02:22:23 +09:00
10 changed files with 68 additions and 2 deletions

View file

@ -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();
}
}