mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-23 02:17:47 +01:00
test ignore
This commit is contained in:
parent
e143dcb450
commit
c0cadded4c
1 changed files with 4 additions and 8 deletions
|
@ -1793,10 +1793,8 @@ const ctx = canvas.getContext("2d")
|
||||||
let step;
|
let step;
|
||||||
|
|
||||||
const draw = () => {
|
const draw = () => {
|
||||||
if (AMvideo.readyState >= 2) { // Check if video is playable (HAVE_CURRENT_DATA or greater)
|
|
||||||
ctx.drawImage(AMvideo, 0, 0, canvas.width, canvas.height);
|
ctx.drawImage(AMvideo, 0, 0, canvas.width, canvas.height);
|
||||||
}
|
};
|
||||||
};
|
|
||||||
|
|
||||||
const drawLoop = () => {
|
const drawLoop = () => {
|
||||||
draw()
|
draw()
|
||||||
|
@ -1809,13 +1807,11 @@ const drawPause = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
document.addEventListener("DOMContentLoaded", () => {
|
|
||||||
AMvideo.addEventListener("canplaythrough", draw, false);
|
AMvideo.addEventListener("canplaythrough", draw, false);
|
||||||
AMvideo.addEventListener("play", drawLoop, false);
|
AMvideo.addEventListener("play", drawLoop, false);
|
||||||
AMvideo.addEventListener("pause", drawPause, false);
|
AMvideo.addEventListener("pause", drawPause, false);
|
||||||
AMvideo.addEventListener("ended", drawPause, false);
|
AMvideo.addEventListener("ended", drawPause, false);
|
||||||
});
|
};
|
||||||
};
|
|
||||||
|
|
||||||
const cleanup = () => {
|
const cleanup = () => {
|
||||||
AMvideo.removeEventListener("loadeddata", draw)
|
AMvideo.removeEventListener("loadeddata", draw)
|
||||||
|
|
Loading…
Reference in a new issue