Skip to content
GitLab
    • Why GitLab
    • Pricing
    • Contact Sales
    • Explore
  • Why GitLab
  • Pricing
  • Contact Sales
  • Explore
  • Sign in
  • Get free trial
  • html-validate
  • html-validate
  • Issues
  • #84

Rule request: no-autoplay

A rule which gives an error when using <audio> and <video> with the autoplay attribute.

Autoplay can be disturbing for users and have accessibility concerns.

The rule should be enabled by default.

Examples

Valid:

<audio ..></audio>
<video ..></video>

Invalid:

<audio autoplay ..></audio>
<video autoplay ..></video>

Options

  • include for a list of elements to include, default null
  • exclude for a list of elements to exclude, default null

Both options should work with a default list of ["audio", "video"] and should not be mutually exclusive. See other rules such as prefer-native.

Assignee
Assign to
Time tracking