This commit is contained in:
Ashley 2023-12-08 18:34:00 +00:00
parent 02646279d1
commit ad0c20300b

View file

@ -1776,7 +1776,6 @@ if (userID) {
<script> <script>
let requestId; let requestId;
let lastDraw;
const loopStart = () => { const loopStart = () => {
requestId = window.requestAnimationFrame(loopStart) requestId = window.requestAnimationFrame(loopStart)
@ -1798,17 +1797,9 @@ const draw = () => {
} }
// Adjust the frame rate by changing the interval
const frameRate = 4; // Set the desired frame rate in milliseconds
const drawLoop = () => { const drawLoop = () => {
draw() draw()
step = window.requestAnimationFrame(drawLoop)
setInterval(() => {
step = window.requestAnimationFrame(drawLoop);
}, 50);
} }
const drawPause = () => { const drawPause = () => {
@ -1817,11 +1808,9 @@ const drawPause = () => {
} }
const init = () => { const init = () => {
AMvideo.addEventListener("loadeddata", drawLoop, false) AMvideo.addEventListener("loadeddata", draw, false)
AMvideo.addEventListener("seeked", draw, false) AMvideo.addEventListener("seeked", draw, false)
setInterval(function() { AMvideo.addEventListener("play", drawLoop, false)
AMvideo.addEventListener("play", drawLoop, false);
}, 50);
AMvideo.addEventListener("pause", drawPause, false) AMvideo.addEventListener("pause", drawPause, false)
AMvideo.addEventListener("ended", drawPause, false) AMvideo.addEventListener("ended", drawPause, false)
} }