This technique relates to Success Criterion 1.4.2: Audio Control (Failure).
This failure occurs when an
video element with an audio track contains the
autoplay attribute and does not contain the
muted attribute, and no controls or commands have been provided to pause or stop the media
autoplay attribute is present, the user agent will automatically begin playback of the media
resource as soon as it can do so without stopping. When the
muted attribute is present, the user agent will initially mute the media resource's audio
output, overriding any user preference.
If the media element is shorter than 3 seconds, the failure does not occur. If the user agent provides user preferences to override autoplay behavior, the failure does not occur.
The HTML spec contains the following notes:
- User agents do not need to support autoplay, and it is suggested that user agents
honor user preferences on the matter. Authors are urged to use the
autoplayattribute rather than using script to force the video to play, so as to allow the user to override the behavior if so desired.
- Authors are urged to use the
autoplayattribute rather than using script to trigger automatic playback, as this allows the user to override the automatic playback when it is not desired, e.g. when using a screen reader. Authors are also encouraged to consider not using the automatic playback behavior at all, and instead to let the user agent wait for the user to start playback explicitly.
Example 1: An auto-playing audio track
In this example, the advertising video contains an audio track. The video will play
continuously because of the
loop attribute, and the video will start automatically because of the
autoplay attribute and because there does not appear to be any controls to allow the user
to stop the video.
<video src="ads.cgi?kind=video" autoplay loop></video>
Resources are for information purposes only, no endorsement implied.
- Check if an
videoelement has an active audio track.
- Check if the audio or video lasts longer than 3 seconds.
- Check if the element has an
- Check if the element does not have a
- Check if no command or control has been provided to stop or pause the media element.
- If checks 1-5 are true, then this failure condition applies and the content fails the Success Criterion.