From 15417388930ca71afa4c82c5a6be60589b915340 Mon Sep 17 00:00:00 2001 From: Can-Chen <50009783+Can-Chen@users.noreply.github.com> Date: Wed, 25 Dec 2024 08:20:06 +0800 Subject: [PATCH] fix: execution exception for empty video src (#772) Co-authored-by: can.chen --- src/utils/handlePrintWindowOnLoad.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/handlePrintWindowOnLoad.ts b/src/utils/handlePrintWindowOnLoad.ts index be501e7..7d9b645 100644 --- a/src/utils/handlePrintWindowOnLoad.ts +++ b/src/utils/handlePrintWindowOnLoad.ts @@ -188,7 +188,9 @@ export function handlePrintWindowOnLoad( } else { if (videoNode.readyState >= 2) { // Check if the video has already loaded a frame markLoaded(videoNode); - } else { + } else if (!videoNode.src) { + markLoaded(videoNode, ["video src empty", videoNode, "Error"]); + } else{ videoNode.onloadeddata = () => { markLoaded(videoNode) };