Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 80f0bf - audio or video avoids automatically playing audio #1655

Open
wants to merge 52 commits into
base: develop
Choose a base branch
from

Conversation

carlosapaduarte
Copy link
Member

  • Change composite rule to atomic
  • Update applicability to only consider media with more than 3 seconds of audio
  • Update expectations and test cases to match the ones in the previous atomic "audio or video that plays automatically has a control mechanism"

Closes issue(s):

Need for Final Call:

  • This will require a 2 weeks Final Call

How to Review And Approve

  • Go to the “Files changed” tab
  • Here you will have the option to leave comments on different lines.
  • Once the review is completed, find the “Review changes” button in the top right, select “Approve” (if you are really confident in the rule) or "Request changes" and click “Submit review”.
  • Make sure to also review the proposed Final Call period. In case of disagreement, the longer period wins.

@carlosapaduarte carlosapaduarte added Rule Update Use this label for an existing rule that is being updated reviewers wanted labels Jun 18, 2021
@carlosapaduarte carlosapaduarte self-assigned this Jun 18, 2021
ajanec01
ajanec01 previously approved these changes Jun 18, 2021
- [Audio Or Video That Plays Automatically Has No Audio That Lasts More Than 3 Seconds](https://act-rules.github.io/rules/aaa1bf)
## Expectation 2

The [instrument][] to pause or stop or turn the audio volume off is [visible](#visible), has an [accessible name](#accessible-name) that is not only [whitespace](#whitespace), and is [included in the accessibility tree](#included-in-the-accessibility-tree).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The [instrument][] to pause or stop or turn the audio volume off is [visible](#visible), has an [accessible name](#accessible-name) that is not only [whitespace](#whitespace), and is [included in the accessibility tree](#included-in-the-accessibility-tree).
The [instrument][] to pause or stop or turn the audio volume off is [visible](#visible), [included in the accessibility tree](#included-in-the-accessibility-tree), and it has an [accessible name](#accessible-name) that is not only [whitespace](#whitespace).

My preference, feel free to ignore.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think this expectation should go away in favour of #1632 (where I somehow seem to have forgotten to remove it 😖 )

Jym77
Jym77 previously requested changes Jul 1, 2021
- [Audio Or Video That Plays Automatically Has No Audio That Lasts More Than 3 Seconds](https://act-rules.github.io/rules/aaa1bf)
## Expectation 2

The [instrument][] to pause or stop or turn the audio volume off is [visible](#visible), has an [accessible name](#accessible-name) that is not only [whitespace](#whitespace), and is [included in the accessibility tree](#included-in-the-accessibility-tree).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think this expectation should go away in favour of #1632 (where I somehow seem to have forgotten to remove it 😖 )

@@ -89,12 +96,12 @@ This `audio` element has an [instrument][] to pause, stop, or turn the audio vol

#### Passed Example 2

This `video` element does not play for longer than 3 seconds.
This `video` element has an [instrument][] to pause, stop, or turn the audio volume off.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This `video` element has an [instrument][] to pause, stop, or turn the audio volume off.
This `video` element has (in its default controls) an [instrument][] to pause it, an [instrument][] to stop it, and an [instrument][] to turn its audio volume off.

@carlosapaduarte carlosapaduarte dismissed stale reviews from Jym77 and ajanec01 July 16, 2021 17:53

changes made


This rule assumes that the [mechanism](https://www.w3.org/TR/WCAG21/#dfn-mechanism) to control the sound must be visible and accessible in order to be effective and usable by all kinds of users. If the mechanism is hidden to some users, it is possible to fail this rule but still satisfy [Success Criterion 1.4.2 Audio Control][sc142].

No [user style sheets](https://drafts.csswg.org/css-cascade/#cascade-origin-user) are used and no changes to the [user agent default style sheet](https://drafts.csswg.org/css-cascade/#cascade-origin-ua) are in place, otherwise the test cases might have different outcomes of the ones presented here.
Copy link
Collaborator

@ajanec01 ajanec01 Jul 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that part go under the Test Cases heading to be in line with #1654 ? Otherwise approving.

@@ -1,9 +1,9 @@
---
id: 80f0bf
name: '`audio` or `video` avoids automatically playing audio'
rule_type: composite
rule_type: atomic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this change requires us to deprecate the 3 previous rules, and have a new one.

@@ -51,29 +53,32 @@ This rule applies to any `audio` or `video` element for which all the following
- **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
- **duration**: the element has a [media resource][] lasting more than 3 seconds and that contains audio.
- **audio duration**: the element has a [media resource][] for which the audio output lasts more than 3 seconds.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems slightly ambiguous to me. Should we do this based on the duration property?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not work based on the duration because the media resource could have a duration longer than 3 seconds, while the audio in the media resource is shorter than 3 seconds.

What exactly is ambiguous in the current description?

@carlosapaduarte
Copy link
Member Author

Following @WilcoFiers suggestion, I deprecated the 3 rules and created a new one with the changes that have been made to transform the prior composite into an atomic.
Ready for reviewing again

@carlosapaduarte carlosapaduarte dismissed Jym77’s stale review March 30, 2022 19:56

Enough changes made for needing you to review again

@carlosapaduarte carlosapaduarte requested a review from Jym77 March 30, 2022 19:56
Comment on lines 55 to 58
- **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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use dfn elements for the condition list (and possibly link to the correct condition from corresponding examples).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added dfn elements and updated inapplicable examples accordingly

@carlosapaduarte
Copy link
Member Author

Changes made

@carlosapaduarte carlosapaduarte requested a review from Jym77 January 9, 2023 19:06
Copy link
Collaborator

@Jym77 Jym77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, approving already.


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].

This rule assumes that the [instrument][] to control the sound is 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].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should that be merged with the Background note on the same topic?
I'm not sure this needs to be an Assumption (since we do have a "further testing needed" mapping already).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

### Bibliography

- [Understanding Success Criterion 1.4.2: Audio Control](https://www.w3.org/WAI/WCAG21/Understanding/audio-control.html)
- [Accessible Multimedia](https://developer.mozilla.org/en-US/docs/Learn/Accessibility/Multimedia)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to link to MDN from a W3C site?
Is there some similar W3C document we could link to instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion!

<audio src="/test-assets/moon-audio/moon-speech.mp3" autoplay></audio>
```

#### Failed Example 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example somewhat contradicts the idea that whether a failed example fails shouldn't depend on accessibility support. I'm a little worried this example could block implementations that run in Chromium. I know that could happen in axe Pro (although we have no tools testing this today). I'm pretty sure Trusted Tester would be impacted though, as it is tested in Edge.

So from that angle I'm not sure I would want this example in. On the other hand, not having a failed video example in it feels like a problem too. We could possibly wait with this rule until we have this "optional examples" idea worked out. A different option could be to modify the rule so that it isn't just about autocomplay, but more generally about media elements that start playing without user interaction within the first 3 second of the page loading? That feels like a reasonable improvement on this rule anyway, and we could then add videos that get turned on through a script during onload.

…4.md

Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewers wanted Rule Update Use this label for an existing rule that is being updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to update audio or video has no audio that plays automatically (80f0bf)?
4 participants