fix: 预览播放器三修 - 素材静音+自动连播+标题显示 #1431

Closed
xiaoxia wants to merge 1 commits from fix/preview-player-v4 into develop
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)