From e2691df43e4dbd8eb65bbea1107b621550605780 Mon Sep 17 00:00:00 2001 From: zhangxiang <31364579+msterzhang@users.noreply.github.com> Date: Sun, 28 May 2023 19:12:55 +0800 Subject: [PATCH] fix: subtitle loss when switching videos with different resolutions (#87) --- src/pages/home/previews/aliyun_video.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pages/home/previews/aliyun_video.tsx b/src/pages/home/previews/aliyun_video.tsx index 488123694..d2f60a621 100644 --- a/src/pages/home/previews/aliyun_video.tsx +++ b/src/pages/home/previews/aliyun_video.tsx @@ -174,6 +174,12 @@ const Preview = () => { replace(videos[index + 1].name) } }) + // Fixed subtitle loss when switching videos with different resolutions + if(subtitle){ + player.on("video:play", (url) => { + player.subtitle.url = proxyLink(subtitle, true); + }); + } }) }) onCleanup(() => {