small responsiveness improvements

broadcast every change
This commit is contained in:
cv
2021-04-24 22:01:40 +02:00
parent 3461a32fa9
commit 01eec95637
2 changed files with 57 additions and 49 deletions
+3 -4
View File
@@ -119,14 +119,11 @@ class Timer {
return Timer.toSeconds(this.current);
}
get playState() {
return this.state;
}
// playback
start() {
// do we need to change
if (this.state === 'start') return;
else if (this.duration === 0) return;
else if (this.startedAt == null) {
const now = this._getCurrentTime();
this._startedAt = now;
@@ -146,6 +143,8 @@ class Timer {
// do we need to change
if (this.state === 'pause') return;
else if (this.duration === 0) return;
// update pause time
this._pausedAt = this._getCurrentTime();