From 347371a15c5d0ac2748bb586c7159b43f9789679 Mon Sep 17 00:00:00 2001 From: lqtdys Date: Wed, 2 Dec 2026 16:35:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(video):=20=E7=BC=A9=E7=95=A5=E5=9B=BE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=97=B6=E9=9A=90=E8=97=8F=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E6=9D=A1=E6=97=B6=E9=97=B4=E6=B0=94=E6=B3=A1=EF=BC=8C=E5=90=8C?= =?UTF-8?q?=E5=B1=8F=E5=8D=95=E6=97=B6=E9=97=B4=EF=BC=88#1953=20=E5=A4=8D?= =?UTF-8?q?=E6=B5=8B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #1953 --- .artifacts/1953/state-coverage.json | 14 ++++++++++++++ e2e/video-controls.spec.ts | 8 ++++++++ src/components/Content/VideoPlayer.tsx | 7 +++++++ src/styles/player.css | 6 ++++++ 4 files changed, 35 insertions(+) diff --git a/.artifacts/1953/state-coverage.json b/.artifacts/1953/state-coverage.json index f2c3eaad..b9475b60 100644 --- a/.artifacts/1953/state-coverage.json +++ b/.artifacts/1953/state-coverage.json @@ -27,6 +27,20 @@ "assertion": "passed", "recorded_at": "2026-12-02T07:46:46Z", "runner": "mason@MMBP" + }, + { + "state": "05-thumb-tip-hidden", + "screenshot": "/Users/mason/ToHighs/clairis/.artifacts/1953/05-thumb-tip-hidden.png", + "assertion": "passed", + "recorded_at": "2026-12-02T08:34:11Z", + "runner": "mason@MMBP" + }, + { + "state": "06-dark-thumb-tip-hidden", + "screenshot": "/Users/mason/ToHighs/clairis/.artifacts/1953/06-dark-thumb-tip-hidden.png", + "assertion": "passed", + "recorded_at": "2026-12-02T08:34:12Z", + "runner": "mason@MMBP" } ] } diff --git a/e2e/video-controls.spec.ts b/e2e/video-controls.spec.ts index a75e5c90..34458854 100644 --- a/e2e/video-controls.spec.ts +++ b/e2e/video-controls.spec.ts @@ -275,6 +275,14 @@ test("进度条悬停显示当前位置缩略图,移开消失", async ({ page const gap = box.y - (tb.y + tb.height); expect(gap).toBeGreaterThanOrEqual(0); expect(gap).toBeLessThanOrEqual(12); + // 缩略图显示时,Artplayer 自带的时间气泡隐藏——同屏只留一个时间来源(#1953) + const tipDisplay = await page.evaluate(() => { + const tip = document.querySelector( + ".art-video-player .art-progress-tip", + ) as HTMLElement | null; + return tip ? getComputedStyle(tip).display : "absent"; + }); + expect(tipDisplay).toBe("none"); await page.mouse.move(box.x + box.width / 2, box.y - 80); await expect(page.locator('[data-testid="video-thumb"]')).toHaveCount(0); }); diff --git a/src/components/Content/VideoPlayer.tsx b/src/components/Content/VideoPlayer.tsx index b0a44447..7874e97d 100644 --- a/src/components/Content/VideoPlayer.tsx +++ b/src/components/Content/VideoPlayer.tsx @@ -323,6 +323,13 @@ export default function VideoPlayer({ } | null>(null); const thumbCanvasRef = useRef(null); const thumbVideoRef = useRef(null); + // 缩略图显隐同步到 $player 类:隐藏 Artplayer 自带的时间气泡, + // 避免与缩略图同屏两处时间(#1953 复测;音频无缩略图,气泡保留)。 + useEffect(() => { + const player = artRef.current?.template?.$player; + if (!player) return; + player.classList.toggle("vp-thumb-show", thumb !== null); + }, [thumb]); const [shotNotice, setShotNotice] = useState<{ text: string; left: number; diff --git a/src/styles/player.css b/src/styles/player.css index 83031ee2..fc2bf796 100644 --- a/src/styles/player.css +++ b/src/styles/player.css @@ -256,3 +256,9 @@ .art-video-player.art-video-player .hint--right:before { border-right-color: var(--app-surface) !important; } + +/* 缩略图显示时隐藏 Artplayer 自带的时间气泡(.art-progress-tip): + 与缩略图同屏两处时间重复;音频无缩略图不触此类,气泡保留(#1953 复测)。 */ +.art-video-player.art-video-player.vp-thumb-show .art-progress-tip { + display: none; +}