From 8eebd7ecd69922d1cff85a24e3f9a274dfd08e43 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Sun, 17 Mar 2024 23:41:18 +0800 Subject: [PATCH] improve error --- src/App.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 4615b4f..43c6eba 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -923,8 +923,11 @@ function App() { if (resetPlaybackRate) video!.playbackRate = outputPlaybackRate; video?.play().catch((err) => { + if (err instanceof Error && err.name === 'AbortError' && 'code' in err && err.code === 20) { // Probably "DOMException: The play() request was interrupted by a call to pause()." + console.error(err); + } else { showPlaybackFailedMessage(); - console.error(err, Object.entries(err)); + } }); }, [filePath, outputPlaybackRate, playing]);