aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Buttons.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/Buttons.hx')
-rw-r--r--src/client/Buttons.hx17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx
index ffc7667..625a71f 100644
--- a/src/client/Buttons.hx
+++ b/src/client/Buttons.hx
@@ -111,9 +111,13 @@ class Buttons {
}
final fullscreenBtn = ge("#fullscreenbtn");
fullscreenBtn.onclick = e -> {
- final el = ge("#ytapiplayer");
- Utils.toggleFullScreen(el);
+ if (Utils.isTouch() && !Utils.hasFullscreen()) {
+ Utils.requestFullscreen(document.documentElement);
+ } else {
+ Utils.requestFullscreen(ge("#ytapiplayer"));
+ }
}
+ initPageFullscreen();
final getPlaylist = ge("#getplaylist");
getPlaylist.onclick = e -> {
final text = main.getPlaylistLinks().join(",");
@@ -316,4 +320,13 @@ class Buttons {
});
}
+ static function initPageFullscreen():Void {
+ document.onfullscreenchange = e -> {
+ final el = document.documentElement;
+ if (Utils.hasFullscreen()) {
+ if (e.target == el) el.classList.add("mobile-view");
+ } else el.classList.remove("mobile-view");
+ }
+ }
+
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage