no-autoplay
Angular templatesHTMLVue / SvelteVue / Sveltesuspiciousno fixdefault: offhtml/html-validate-recommended
What it does
Section titled “What it does”Reports <audio> and <video> with autoplay and without muted.
Why it matters
Section titled “Why it matters”Sound that starts by itself startles users, drowns out a screen reader, and fails accessibility guidelines. Browsers block it in many cases, so the page also behaves differently from one visit to the next.
To fix, remove autoplay, or add muted.
Example
Section titled “Example”...<input type="text" name="b">...<video autoplay></video><video controls></video></body></html>Configuration
Section titled “Configuration”angular: lint: rules: no-autoplay: warn # off (default), warn, errorhtml: lint: rules: no-autoplay: warn # off (default), warn, errorsvelte: lint: rules: no-autoplay: warn # off (default), warn, errorvue: lint: rules: no-autoplay: warn # off (default), warn, errorEnabled by the presets: html/html-validate-recommended.
Suppress one line with sudsy-disable-next-line no-autoplay in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| html-validate | no-autoplay |
full |