aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-04-26 23:37:29 +0300
committerRblSb <msrblsb@gmail.com>2020-04-26 23:37:29 +0300
commit9f93fb9783c4647a0e25b67078dded196d035ca9 (patch)
treea12ebef2b5ff5da710176654d9144c2acafaf706 /build
parente0f2520fb03ed07a38e96c012c0f599b2fbe7f04 (diff)
Fix posible double skip / npe
Diffstat (limited to 'build')
-rw-r--r--build/server.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/build/server.js b/build/server.js
index dae3674..bcff638 100644
--- a/build/server.js
+++ b/build/server.js
@@ -1414,9 +1414,15 @@ server_Main.prototype = {
if(this.videoList.length == 0) {
return;
}
- if(this.videoTimer.getTime() > this.videoList[this.itemPos].duration - 0.01) {
- this.videoTimer.stop();
+ var maxTime = this.videoList[this.itemPos].duration - 0.01;
+ if(this.videoTimer.getTime() > maxTime) {
+ this.videoTimer.pause();
+ this.videoTimer.setTime(maxTime);
+ var currentLength = this.videoList.length;
haxe_Timer.delay(function() {
+ if(_gthis.videoList.length != currentLength) {
+ return;
+ }
_gthis.onMessage(client,{ type : "SkipVideo", skipVideo : { url : _gthis.videoList[_gthis.itemPos].url}});
return;
},1000);
@@ -1429,8 +1435,9 @@ server_Main.prototype = {
if(this.videoTimer.getRate() != 1) {
if(!ClientTools.hasLeader(this.clients)) {
this.videoTimer.setRate(1);
+ } else {
+ obj.getTime.rate = this.videoTimer.getRate();
}
- obj.getTime.rate = this.videoTimer.getRate();
}
this.send(client,obj);
break;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage