From 1b09998cdf400c3277a4ce89c6fdd8f54954c141 Mon Sep 17 00:00:00 2001 From: Troray Date: Sat, 24 Jan 2026 02:46:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(VideoPlayer):=20=E5=A4=84=E7=90=86=20source?= =?UTF-8?q?open=20=E4=B8=8E=E6=B5=8F=E8=A7=88=E5=99=A8=E5=B7=AE=E5=BC=82?= =?UTF-8?q?=20-=20=E4=BC=98=E5=8C=96=20useEffect=20=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E5=BD=93=20source=20=E5=8F=98=E5=8C=96=E6=97=B6?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E7=8A=B6=E6=80=81=20-=20=E7=A1=AE=E4=BF=9D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=8D=E6=96=B0=E8=8E=B7=E5=8F=96=E6=97=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=AD=A3=E7=A1=AE=E7=9A=84=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/hooks/useVideoPlayer.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/hooks/useVideoPlayer.ts b/lib/hooks/useVideoPlayer.ts index 648ac83..8441b51 100644 --- a/lib/hooks/useVideoPlayer.ts +++ b/lib/hooks/useVideoPlayer.ts @@ -169,6 +169,12 @@ export function useVideoPlayer( useEffect(() => { if (videoId && source) { + // Reset state when source changes to ensure clean fetch + setVideoData(null); + setLoading(true); + setVideoError(''); + setCurrentEpisode(0); + setPlayUrl(''); fetchVideoDetails(); } }, [videoId, source, fetchVideoDetails]);