aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Main.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/Main.hx')
-rw-r--r--src/client/Main.hx42
1 files changed, 23 insertions, 19 deletions
diff --git a/src/client/Main.hx b/src/client/Main.hx
index 84f6838..5c4b28d 100644
--- a/src/client/Main.hx
+++ b/src/client/Main.hx
@@ -120,7 +120,7 @@ class Main {
if (!player.isVideoLoaded()) return;
gotFirstPageInteraction = true;
player.unmute();
- if (!hasLeader() && !showingServerPause) player.play();
+ if (!hasLeader() && !showingServerPause && !player.inUserInteraction) player.play();
document.removeEventListener("click", onFirstInteraction);
}
@@ -508,24 +508,7 @@ class Main {
serverMessage(text);
case Progress:
- final data = data.progress;
- final text = switch data.type {
- case Caching:
- final caching = Lang.get("caching");
- final name = data.data;
- '$caching $name';
- case Downloading: Lang.get("downloading");
- case Uploading: Lang.get("uploading");
- }
- final percent = (data.ratio * 100).toFixed(1);
- var text = '$text...';
- if (percent > 0) text += ' $percent%';
- showProgressInfo(text);
- if (data.ratio == 1) {
- Timer.delay(() -> {
- hideDynamicChin();
- }, 500);
- }
+ onProgressEvent(data);
case AddVideo:
player.addVideoItem(data.addVideo.item, data.addVideo.atEnd);
@@ -675,6 +658,27 @@ class Main {
}
}
+ public function onProgressEvent(data:WsEvent):Void {
+ final data = data.progress;
+ final text = switch data.type {
+ case Caching:
+ final caching = Lang.get("caching");
+ final name = data.data;
+ '$caching $name';
+ case Downloading: Lang.get("downloading");
+ case Uploading: Lang.get("uploading");
+ }
+ final percent = (data.ratio * 100).toFixed(1);
+ var text = '$text...';
+ if (percent > 0) text += ' $percent%';
+ showProgressInfo(text);
+ if (data.ratio == 1) {
+ Timer.delay(() -> {
+ hideDynamicChin();
+ }, 500);
+ }
+ }
+
function updateLastStateTime():Void {
if (lastStateTimeStamp == 0) {
lastStateTimeStamp = Timer.stamp();
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage