diff --git a/_rules/audio-or-video-avoids-automatically-playing-audio-80f0bf.md b/_rules/audio-or-video-avoids-automatically-playing-audio-80f0bf.md old mode 100755 new mode 100644 index 11bf3b3c05..63c2924057 --- a/_rules/audio-or-video-avoids-automatically-playing-audio-80f0bf.md +++ b/_rules/audio-or-video-avoids-automatically-playing-audio-80f0bf.md @@ -1,6 +1,6 @@ --- id: 80f0bf -name: Audio or video element avoids automatically playing audio +name: DEPRECATED - Audio or video element avoids automatically playing audio rule_type: composite description: | This rule checks that audio or video that plays automatically does not have audio that lasts for more than 3 seconds or has an audio control mechanism to stop or mute it. @@ -43,6 +43,8 @@ acknowledgments: assets: - Rabbit video is © copyright 2008, Blender Foundation / [www.bigbuckbunny.org](https://www.bigbuckbunny.org) - JFK's "We Choose the Moon" speech excerpt is courtesy of NASA. +deprecated: | + This rule has been deprecated and superceded by Rule [`audio` or `video` avoids automatically playing audio](https://act-rules.github.io/rules/x0paj4). This rule is not maintained anymore and should not be used. htmlHintIgnore: # https://www.npmjs.com/package/htmlhint # (used with `npm test` to ensure validity of code snippets) diff --git a/_rules/audio-or-video-avoids-automatically-playing-audio-x0paj4.md b/_rules/audio-or-video-avoids-automatically-playing-audio-x0paj4.md new file mode 100644 index 0000000000..1288781c15 --- /dev/null +++ b/_rules/audio-or-video-avoids-automatically-playing-audio-x0paj4.md @@ -0,0 +1,206 @@ +--- +id: x0paj4 +name: '`audio` or `video` avoids automatically playing audio' +rule_type: atomic +description: | + This rule checks that audio or video that plays automatically with audio that lasts for more than 3 seconds has an audio control mechanism to stop or mute it. +accessibility_requirements: + wcag20:1.4.2: # Audio Control (A) + forConformance: true + failed: not satisfied + passed: further testing needed + inapplicable: further testing needed + wcag-text:cc5: # Non-interference due to mapping to 1.4.2 + title: WCAG Non-Interference + forConformance: true + failed: not satisfied + passed: further testing needed + inapplicable: further testing needed + wcag-technique:G60: # Playing a sound that turns off automatically within three seconds + forConformance: false + failed: not satisfied + passed: further testing needed + inapplicable: further testing needed + wcag-technique:G170: # Providing a control near the beginning of the Web page that turns off sounds that play automatically + forConformance: false + failed: not satisfied + passed: further testing needed + inapplicable: further testing needed + wcag-technique:G171: # Playing sounds only on user request + forConformance: false + failed: not satisfied + passed: further testing needed + inapplicable: further testing needed +input_aspects: + - DOM Tree + - CSS Styling + - Audio output + - Visual output +acknowledgments: + authors: + - Carlos Duarte + previous_authors: + - Anne Thyme Nørregaard + - Bryn Anderson +htmlHintIgnore: + # https://www.npmjs.com/package/htmlhint + # (used with `npm test` to ensure validity of code snippets) + - 'title-require' +--- + +## Applicability + +This rule applies to any `audio` or `video` element for which all the following are true: + +- autoplay: the element has an `autoplay` [attribute value][] of `true`; and +- not muted: the element has a `muted` [attribute value][] of `false`; and +- not paused: the element has a `paused` [attribute value][] of `false`; and +- audio duration: the element has a [media resource][] for which the audio output lasts longer than 3 seconds. + +## Expectation + +For each test target, there is at least one [instrument][] in the same [web page][] to pause, stop, or mute the audio. + +## Assumptions + +This rule assumes that it is not sufficient for the [instrument][] to control the sound to be located on a different [web page][], or a different state of the same [web page][] to pass the rule. [Instruments][instrument] located on other pages can still create accessibility issues for users relying on sound to navigate (e.g. screen reader users) since the autoplaying sound will interfere with their ability to find and activate the [instrument][]. If an [instrument][] external to the [web page][] is provided, this rule will fail but it is still possible to satisfy [Success Criterion 1.4.2 Audio Control][sc142]. + +## Accessibility Support + +Some major browsers do not automatically play the 'video' unless the 'video' is muted. For these, the rule is never applicable. But for browsers that autoplay not muted video, the rule is still applicable. + +## Background + +The [instruments][instrument] used to pass this rule (if any), must meet all level A Success Criteria in order to fully satisfy [Success Criterion 1.4.2 Audio Control][sc142]. This means the [instrument][] to control the sound should be visible and accessible in order to be effective and usable by all kinds of users. If the [instrument][] is hidden to some users, it is possible to pass this rule but still not satisfy [Success Criterion 1.4.2 Audio Control][sc142]. These extra requirements are left out of this rule, and should be tested separately. + +### Bibliography + +- [Understanding Success Criterion 1.4.2: Audio Control](https://www.w3.org/WAI/WCAG21/Understanding/audio-control.html) +- [Making Audio and Video Media Accessible](https://www.w3.org/WAI/media/av/) +- [Failure of Success Criterion 1.4.2 for absence of a way to pause or stop an HTML5 media element that autoplays](https://www.w3.org/WAI/WCAG21/Techniques/failures/F93) +- [G170: Providing a control near the beginning of the Web page that turns off sounds that play automatically](https://www.w3.org/WAI/WCAG21/Techniques/general/G170) + +## Test Cases + +### Passed + +#### Passed Example 1 + +This `audio` element has its default controls as an [instrument][] to pause, stop, and mute the audio. + +```html + +``` + +#### Passed Example 2 + +This `video` element has its default controls as an [instrument][] to pause, stop mute the audio. + +```html + +``` + +#### Passed Example 3 + +This `video` element autoplays and has an [instrument][] to pause, stop, or mute the audio. + +```html +
+