mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 05:41:20 -08:00
update controls
This commit is contained in:
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 = ()=>{
|
||||
|
||||
Reference in new issue
Block a user