mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb: Add a button to the built-in media player to toggle fullscreen
This commit is contained in:
committed by
Gregory Bertilson
parent
2282636f98
commit
24aacfea48
Notes:
github-actions[bot]
2026-03-01 21:42:56 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/24aacfea48a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8219 Reviewed-by: https://github.com/Zaggy1024
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2020, the SerenityOS developers.
|
||||
* Copyright (c) 2023-2024, Tim Flynn <trflynn89@serenityos.org>
|
||||
* Copyright (c) 2023-2026, Tim Flynn <trflynn89@ladybird.org>
|
||||
* Copyright (c) 2025-2026, Gregory Bertilson <gregory@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
@@ -476,6 +476,16 @@ void HTMLMediaElement::set_muted(bool muted)
|
||||
set_needs_style_update(true);
|
||||
}
|
||||
|
||||
void HTMLMediaElement::toggle_fullscreen()
|
||||
{
|
||||
auto& document = this->document();
|
||||
|
||||
if (document.fullscreen_element() == this)
|
||||
document.exit_fullscreen();
|
||||
else
|
||||
request_fullscreen();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/media.html#user-interface:dom-media-volume-3
|
||||
void HTMLMediaElement::volume_or_muted_attribute_changed()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user