From 034063d214c0f6325e43dd8c7db6fc4f168b375b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=99=BD-=E7=99=BD?= Date: Sat, 26 Apr 2025 16:53:40 +0800 Subject: [PATCH] fix(video player): specify the video type Since the link may not include the file extension. --- src/component/Viewers/Video/Artplayer.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/component/Viewers/Video/Artplayer.tsx b/src/component/Viewers/Video/Artplayer.tsx index 0484b25..c84226f 100644 --- a/src/component/Viewers/Video/Artplayer.tsx +++ b/src/component/Viewers/Video/Artplayer.tsx @@ -127,6 +127,7 @@ export default function Player({ ...rest }: PlayerProps) { const artRef = useRef(); + const ext = fileExtension(option.title); useEffect(() => { const opts = { @@ -138,13 +139,14 @@ export default function Player({ m3u8: playM3u8(m3u8UrlTransform, getEntityUrl), flv: playFlv, }, + type: ext, }; if (chapters) { opts.plugins.push(artplayerPluginChapter({ chapters })); } - if (fileExtension(option.title) === "m3u8") { + if (ext === "m3u8") { opts.plugins.push( artplayerPluginHlsControl({ quality: {