mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 10:58:25 +01:00
test ignore
This commit is contained in:
parent
4f181670bb
commit
fb935907e7
1 changed files with 4 additions and 11 deletions
|
@ -1801,16 +1801,7 @@ const draw = () => {
|
||||||
// Adjust the frame rate by changing the interval
|
// Adjust the frame rate by changing the interval
|
||||||
const frameRate = 4; // Set the desired frame rate in milliseconds
|
const frameRate = 4; // Set the desired frame rate in milliseconds
|
||||||
|
|
||||||
const drawLoopWithInterval = () => {
|
|
||||||
const now = performance.now();
|
|
||||||
|
|
||||||
if (!lastDraw || now - lastDraw >= frameRate) {
|
|
||||||
draw();
|
|
||||||
lastDraw = now;
|
|
||||||
}
|
|
||||||
|
|
||||||
step = window.requestAnimationFrame(drawLoopWithInterval);
|
|
||||||
};
|
|
||||||
|
|
||||||
const drawLoop = () => {
|
const drawLoop = () => {
|
||||||
draw()
|
draw()
|
||||||
|
@ -1828,7 +1819,9 @@ const drawPause = () => {
|
||||||
const init = () => {
|
const init = () => {
|
||||||
AMvideo.addEventListener("loadeddata", drawLoop, false)
|
AMvideo.addEventListener("loadeddata", drawLoop, false)
|
||||||
AMvideo.addEventListener("seeked", draw, false)
|
AMvideo.addEventListener("seeked", draw, false)
|
||||||
AMvideo.addEventListener("play", drawLoopWithInterval, false);
|
setInterval(function() {
|
||||||
|
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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue