fix: sometimes currentTime is smaller than the totalTime when player is finished (#445)
plus: fix the problem that sometimes return value of getCurrentTime() is negative
This commit is contained in:
@@ -39,7 +39,8 @@ export class Timer {
|
||||
let lastTimestamp = performance.now();
|
||||
const { actions } = this;
|
||||
const self = this;
|
||||
function check(time: number) {
|
||||
function check() {
|
||||
const time = performance.now();
|
||||
self.timeOffset += (time - lastTimestamp) * self.speed;
|
||||
lastTimestamp = time;
|
||||
while (actions.length) {
|
||||
|
||||
Reference in New Issue
Block a user