aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Player.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-02-25 12:09:29 +0300
committerRblSb <msrblsb@gmail.com>2020-02-25 12:09:29 +0300
commit1cc391ceb0cf5db62e0422390780e79de2597202 (patch)
treeafacd48f0c1f76f1eaf713ad752d96f3437ebd58 /src/client/Player.hx
parent93410166580465608c370bb36cdc2b953e43b965 (diff)
Hide video controls automatically
Diffstat (limited to 'src/client/Player.hx')
-rw-r--r--src/client/Player.hx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/client/Player.hx b/src/client/Player.hx
index bee9a3c..d8e4cb4 100644
--- a/src/client/Player.hx
+++ b/src/client/Player.hx
@@ -1,5 +1,6 @@
package client;
+import haxe.Timer;
import js.html.Element;
import js.html.VideoElement;
import js.Browser.document;
@@ -29,6 +30,16 @@ class Player {
item.url = main.tryLocalIp(item.url);
video.src = item.url;
video.controls = true;
+ final isTouch = untyped __js__("'ontouchstart' in window");
+ if (!isTouch) Timer.delay(() -> {
+ video.controls = false;
+ video.onmouseover = e -> {
+ video.controls = true;
+ video.onmouseover = null;
+ video.onmousemove = null;
+ }
+ video.onmousemove = video.onmouseover;
+ }, 3000);
video.oncanplaythrough = e -> {
if (!isLoaded) main.send({type: VideoLoaded});
isLoaded = true;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage