From ad7092d5e75ac7186f216ad147fbd21e07c4424a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=87=E5=AE=87?= Date: Tue, 23 Jan 2024 15:10:33 +0800 Subject: [PATCH] fix: Abnormal video size --- src/clone-node.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clone-node.ts b/src/clone-node.ts index 500ce332..9c9e442c 100644 --- a/src/clone-node.ts +++ b/src/clone-node.ts @@ -16,8 +16,8 @@ async function cloneVideoElement(video: HTMLVideoElement, options: Options) { if (video.currentSrc) { const canvas = document.createElement('canvas') const ctx = canvas.getContext('2d') - canvas.width = video.clientWidth - canvas.height = video.clientHeight + canvas.width = video.videoWidth + canvas.height = video.videoHeight ctx?.drawImage(video, 0, 0, canvas.width, canvas.height) const dataURL = canvas.toDataURL() return createImage(dataURL)