From 6bf6f48867798aeaa2c5363f5ff34379efe18d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E4=B8=8A=E8=B4=B5=E7=8C=AA?= <290425385@qq.com> Date: Wed, 11 Mar 2026 08:01:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=83=E5=8D=81=E4=BA=8C=E5=AE=B6=E6=88=BF?= =?UTF-8?q?=E5=AE=A2-=E8=A7=82=E7=9C=8B=E5=B9=B3=E5=8F=B0v1.5.1=20=20-=20?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=92=AD=E6=94=BE=E5=99=A8=20=20-=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=87=AA=E5=8A=A8=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/qishier/QishierVideoPlayer.vue | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/qishier/QishierVideoPlayer.vue b/src/components/qishier/QishierVideoPlayer.vue index 77c4e45..6935f9c 100644 --- a/src/components/qishier/QishierVideoPlayer.vue +++ b/src/components/qishier/QishierVideoPlayer.vue @@ -11,7 +11,7 @@ import Hls from 'hls.js' import type { EpisodeData } from '@/api/qishier' import { getEpisodeProgress, saveEpisodeProgress } from '@/utils/playHistory' -interface ArtplayerWithHls extends Artplayer { +type ArtWithHls = Artplayer & { hls?: Hls } @@ -25,8 +25,8 @@ const emit = defineEmits<{ endedNext: [] }>() -const playerRef = ref(null) -let art: ArtplayerWithHls | null = null +const playerRef = ref(null) +let art: ArtWithHls | null = null function destroyPlayer() { if (art?.hls) { @@ -61,12 +61,12 @@ function buildPlayer(episode: EpisodeData) { mutex: true, theme: '#f5c542', moreVideoAttr: { - playsinline: 'true', - webkitPlaysinline: 'true', - x5Playsinline: 'true' - }, + playsInline: true + } as any, customType: { - m3u8(video: HTMLVideoElement, url: string, artplayer: ArtplayerWithHls) { + m3u8(video: HTMLVideoElement, url: string, artInstance: Artplayer) { + const artplayer = artInstance as ArtWithHls + if (Hls.isSupported()) { const hls = new Hls() artplayer.hls = hls @@ -79,7 +79,7 @@ function buildPlayer(episode: EpisodeData) { } } } - }) as ArtplayerWithHls + }) as ArtWithHls art.type = 'm3u8' @@ -132,7 +132,7 @@ watch( watch( () => props.autoNext, () => { - // 这里只是响应式依赖,让 ended 逻辑读取最新值 + // 让 ended 事件读取最新 autoNext 值 } )