autoplay-media
它能做什么
这项技能检查媒体在页面加载时是否会自行开始播放。适合希望由访客自行决定何时播放媒体的开发者和网站所有者。
适用场景
- ✓当页面一打开就开始播放声音时。
- ✓当视频自动播放,却没有可见的暂停控件时。
- ✓当你添加背景视频或带媒体的幻灯片时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/autoplay-media/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请让我首页的背景视频不再自动带声音播放,并添加一个暂停按钮。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会去掉音频和视频的自动播放;如果确实需要自动播放,则要求媒体必须静音,并添加清晰、可用键盘操作的暂停控件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Avoid autoplaying media
Autoplaying audio drowns out screen reader speech, startles users, and wastes bandwidth—providing user control is essential for accessibility and good UX.
Quick Reference
- Never autoplay audio—it interferes with screen readers
- If video must autoplay, ensure it's muted by default
- Provide immediately accessible pause/stop controls
- Autoplay should stop after 5 seconds or provide stop mechanism
Check
Verify no audio or video autoplays on page load. If autoplay is essential, confirm media is muted by default and pause controls are immediately accessible via keyboard within the first few tab stops.
Fix
Remove autoplay attributes from media elements. If autoplay is required, add muted attribute and provide prominent, keyboard-accessible pause controls. Consider adding a global pause button for pages with multiple media elements.
Explain
Explain how autoplaying media interferes with screen readers, startles users with cognitive disabilities, and creates barriers for users in quiet environments or with limited bandwidth.
Code Review
Review the rendered markup and interactive states that affect Avoid autoplaying media. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/accessibility/autoplay-media
常见问题
自动播放为什么对屏幕阅读器是个问题?
这项技能说明,自动播放的声音会盖过屏幕阅读器的语音。
视频可以自动播放吗?
可以,前提是默认静音,并具有无障碍的暂停控件。
自动播放应该持续多久?
这项技能建议 5 秒后停止,或者让用户能够停止它。
详情
作者的原始描述
Use when reviewing rendered HTML, interactive components, or design-system patterns related to Avoid autoplaying media. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.
热度
- GitHub 星标
- 75k
- 排名
- #2751
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。