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

+4 -6
View File
@@ -8,6 +8,7 @@ export default function artplayerProxyCanvas(callback) {
const video = createElement('video');
video.playsInline = true;
window.video = video;
const track = createElement('track');
track.default = true;
@@ -57,16 +58,13 @@ export default 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);
};