mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 22:01: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
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user