update controls

This commit is contained in:
Harvey Zack committed 2024-09-15 00:24:02 +08:00
1 parent 400ab2f9c4
commit 22dce779d1
4 files changed
+27 -13

No files matched your search

@@ -154,6 +154,7 @@ function artplayerProxyCanvas(callback) {
const ctx = canvas.getContext("2d");
const video = createElement("video");
video.playsInline = true;
window.video = video;
const track = createElement("track");
track.default = true;
track.kind = "metadata";
@@ -201,15 +202,12 @@ function artplayerProxyCanvas(callback) {
}
});
const draw = ()=>{
console.log(video.currentTime);
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
art.emit("artplayerProxyCanvas:draw", ctx);
};
const animation = async ()=>{
try {
await draw();
} catch (error) {
console.error("Error drawing video frame:", error);
}
const animation = ()=>{
draw();
animationFrame = requestAnimationFrame(animation);
};
const resize = ()=>{