(time: number)
| 633 | } |
| 634 | |
| 635 | const animateFPS = (time: number) => { |
| 636 | if (!lastTime) lastTime = time |
| 637 | const delta = time - lastTime |
| 638 | lastTime = time |
| 639 | |
| 640 | acc += delta |
| 641 | |
| 642 | if (adjustedData) { |
| 643 | let delay = getDelay() |
| 644 | |
| 645 | if (acc >= delay) { |
| 646 | update() |
| 647 | acc -= delay |
| 648 | } |
| 649 | } |
| 650 | |
| 651 | draw() |
| 652 | if (paused) return |
| 653 | animationID = requestAnimationFrame(animateFPS) |
| 654 | } |
| 655 | |
| 656 | const animateVideo = async () => { |
| 657 | if (!videoRef.current) return |