fix: 修复预览播放器三个问题 - 素材静音+自动连播+标题显示 (#1431)
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 2m6s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 2m24s
CI/CD Pipeline / PR Build API Image (push) Has been skipped
CI/CD Pipeline / PR Build Web Image (push) Has been skipped
CI/CD Pipeline / PR Build Worker Image (push) Has been skipped
CI/CD Pipeline / Build Staging API Image (push) Successful in 4m19s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 6m25s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 8m9s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 9m52s
CI/CD Pipeline / Unit Tests (push) Successful in 15m4s
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Integration Tests (push) Successful in 6m38s
CI/CD Pipeline / CI Gate (push) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 21m25s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 2m33s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 40s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 47s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m12s
CI/CD Pipeline / Canary Release to Production (push) Has been skipped

1. video 标签添加 muted 属性,静音素材原声只播放配音
2. 片段切换后自动调用 play() 实现连续播放
3. 移除 .xx-preview-video 的 display:grid 并添加 isolation:isolate 修复标题遮挡
This commit is contained in:
张宏杰
2026-08-18 22:04:09 +08:00
parent 094d22cee7
commit 771c7f8b3b
3 changed files with 10 additions and 3 deletions
@@ -256,6 +256,7 @@ const FrontendPreviewPlayer: React.FC<FrontendPreviewPlayerProps> = ({
{/* ✅ 不再创建 .xx-preview-video 容器,直接渲染 video + 覆盖层 */}
{/* video 元素 — 由父组件 .xx-preview-video 容器提供定位和尺寸 */}
<video
muted
ref={videoRef}
preload="auto"
style={{
+1 -2
View File
@@ -895,13 +895,12 @@
max-height: 400px;
border-radius: var(--radius-md);
background: linear-gradient(135deg, var(--color-gray-900), var(--color-primary-900));
display: grid;
place-items: center;
color: var(--text-inverse);
font-size: 36px;
position: relative;
overflow: hidden;
margin-bottom: 16px;
isolation: isolate;
}
.xx-preview-video::before {
@@ -254,7 +254,14 @@ export function useSegmentScheduler(segments: PlaybackSegment[]): SegmentSchedul
if (video.currentTime >= seg.endTime - 0.15) {
const nextIndex = currentSegmentIndex + 1
if (nextIndex < segments.length) {
switchToSegment(nextIndex)
switchToSegment(nextIndex).then(() => {
const v = videoRef.current
if (v) {
v.play().catch((e) =>
console.warn("[useSegmentScheduler] auto-play next segment failed:", e),
)
}
})
const accumulatedTime =
(timelineStarts[currentSegmentIndex] || 0) + (seg.endTime - seg.startTime)
setCurrentTime(accumulatedTime)