aboutsummaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-06-06 10:19:18 +0300
committerRblSb <msrblsb@gmail.com>2020-06-06 13:57:41 +0300
commit41e8165d3d701562af4eb78d86816fd1f88766af (patch)
tree4b0ceed7d2c3300048dbc9dcc587a55640fd0834 /src/client
parent8506b4edcb0a9bb1973bb38fcca4bcdc21e397c1 (diff)
Pause indicator
Diffstat (limited to 'src/client')
-rw-r--r--src/client/Buttons.hx2
-rw-r--r--src/client/Main.hx7
-rw-r--r--src/client/Player.hx9
3 files changed, 17 insertions, 1 deletions
diff --git a/src/client/Buttons.hx b/src/client/Buttons.hx
index 7e9c8cb..771f827 100644
--- a/src/client/Buttons.hx
+++ b/src/client/Buttons.hx
@@ -111,7 +111,7 @@ class Buttons {
}
final fullscreenBtn = ge("#fullscreenbtn");
fullscreenBtn.onclick = e -> {
- if (Utils.isTouch() && !Utils.hasFullscreen()) {
+ if ((Utils.isTouch() || main.isVerbose()) && !Utils.hasFullscreen()) {
Utils.requestFullscreen(document.documentElement);
} else {
Utils.requestFullscreen(ge("#ytapiplayer"));
diff --git a/src/client/Main.hx b/src/client/Main.hx
index 781f5e8..0f6b31e 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -387,11 +387,13 @@ class Main {
if (player.isListEmpty()) player.pause();
case Pause:
+ player.setPauseIndicator(false);
if (isLeader()) return;
player.pause();
player.setTime(data.pause.time);
case Play:
+ player.setPauseIndicator(true);
if (isLeader()) return;
player.setTime(data.play.time);
player.play();
@@ -418,6 +420,7 @@ class Main {
if (player.getDuration() <= player.getTime() + synchThreshold) return;
if (!data.getTime.paused) player.play();
else player.pause();
+ player.setPauseIndicator(!data.getTime.paused);
if (Math.abs(time - newTime) < synchThreshold) return;
player.setTime(newTime);
@@ -812,6 +815,10 @@ class Main {
return config.youtubeApiKey;
}
+ public function isVerbose():Bool {
+ return config.isVerbose;
+ }
+
function escapeRegExp(regex:String):String {
return ~/([.*+?^${}()|[\]\\])/g.replace(regex, "\\$1");
}
diff --git a/src/client/Player.hx b/src/client/Player.hx
index 4de76ce..dd49ab4 100644
--- a/src/client/Player.hx
+++ b/src/client/Player.hx
@@ -146,6 +146,15 @@ class Player {
JsApi.fireVideoRemoveEvents(items[itemPos]);
player.removeVideo();
ge("#currenttitle").textContent = Lang.get("nothingPlaying");
+ setPauseIndicator(true);
+ }
+
+ public function setPauseIndicator(flag:Bool):Void {
+ if (!main.isSyncActive) return;
+ final state = flag ? "play" : "pause";
+ final el = ge("#pause-indicator");
+ if (el.getAttribute("name") == state) return;
+ el.setAttribute("name", state);
}
public function onCanBePlayed():Void {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage