Skip to content

Intro video: replace with 0627.mp4, enable audio#3

Merged
Vector897 merged 1 commit into
mainfrom
feat/intro-audio
Jun 27, 2026
Merged

Intro video: replace with 0627.mp4, enable audio#3
Vector897 merged 1 commit into
mainfrom
feat/intro-audio

Conversation

@Vector897

Copy link
Copy Markdown
Owner

变更内容

原因

原视频无声音是因为 <video> 标签添加了 muted 属性——Chrome 要求有音频的视频必须静音才能自动播放。

本次修复

  • 替换视频frontend/intro.mp40627.mp4(11 MB)
  • 移除 muted:视频现在可正常输出音频
  • 自动播放降级处理
    • 先尝试有声自动播放(vv.play()
    • 若浏览器拦截(play() Promise rejected),显示居中 ▶ Play Intro 按钮
    • 用户点击后以有声模式播放
    • Skip › 按钮始终可用,跳过后直接进入主界面

技术说明

Chrome 自动播放策略:

  • 有音频的视频需要用户首次交互后才能自动播放(Media Engagement Index 未达标时)
  • 在开发环境 / 预览浏览器中通常直接允许
  • 演示时建议在打开页面前先与浏览器有一次任意交互(如点击地址栏)即可触发有声自动播放

测试

  • /intro.mp4 返回 200 video/mp4,Content-Length = 11017941
  • video.muted === false(确认无静音属性)
  • video.ended === true(视频正常播放至结束,触发 startApp() 过渡)
  • #vi 遮罩淡出,主界面正常渲染

Copilot AI review requested due to automatic review settings June 27, 2026 14:56
@Vector897
Vector897 merged commit 6d580f7 into main Jun 27, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the intro video experience to allow audio playback by removing muted, and adds a user-interaction fallback when autoplay with sound is blocked by browser policy.

Changes:

  • Removed muted from the intro <video> so audio can play.
  • Added a centered “▶ Play Intro” button that appears when vv.play() is blocked.
  • Adjusted autoplay handling logic to show the button instead of immediately skipping the intro.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/index.html
Comment on lines +929 to +936
playPromise.catch(function(){
// autoplay blocked — show click-to-play button
if(playBtn) playBtn.style.display="block";
if(playBtn) playBtn.addEventListener("click",function(){
playBtn.style.display="none";
vv.play();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants