跳到正文
Skillpedia
网站与界面(前端)75k · #2751

autoplay-media

它能做什么

这项技能检查媒体在页面加载时是否会自行开始播放。适合希望由访客自行决定何时播放媒体的开发者和网站所有者。

适用场景

  • ✓当页面一打开就开始播放声音时。
  • ✓当视频自动播放,却没有可见的暂停控件时。
  • ✓当你添加背景视频或带媒体的幻灯片时。

技能链接

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/autoplay-media/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/autoplay-media/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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.

repo: thedaviddias/Front-End-Checklist

热度

GitHub 星标
75k
排名
#2751
许可证
MIT
更新时间
2026/10/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能