-
Notifications
You must be signed in to change notification settings - Fork 82
Add inapplicable examples for the audio/video autoplay rule #2371
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
base: develop
Are you sure you want to change the base?
Changes from all commits
5368c1a
b44ddc6
0294a6c
3528a5b
1670ba7
162e9ce
59976c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -57,7 +57,7 @@ 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. | ||||||
| - **play time**: the element has a [media resource][] that contains audio and that stops after no more than 3 seconds. This can be changed by authors, for example using a [temporal media fragment URI](https://www.w3.org/TR/media-frags/#naming-time) (`#t`) in the source URI. | ||||||
|
|
||||||
| ## Expectation | ||||||
|
|
||||||
|
|
@@ -101,18 +101,7 @@ 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. | ||||||
|
|
||||||
| ```html | ||||||
| <video autoplay> | ||||||
| <source src="/test-assets/rabbit-video/video.mp4#t=8,10" type="video/mp4" /> | ||||||
| <source src="/test-assets/rabbit-video/video.webm#t=8,10" type="video/webm" /> | ||||||
| </video> | ||||||
| ``` | ||||||
|
|
||||||
| #### Passed Example 3 | ||||||
|
|
||||||
| This `video` element autoplays and has an [instrument][] to pause, stop, or turn the audio volume off. | ||||||
| This `video` element is longer than 3 seconds, autoplays, and has an [instrument][] to pause, stop, or turn the audio volume off. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Suggestion to clearly separate the conditions that would cause the rule to fail from those that allow it to pass, explicitly highlighting the feature that makes the rule pass. |
||||||
|
|
||||||
| ```html | ||||||
| <head> | ||||||
|
|
@@ -192,6 +181,43 @@ This `video` element has no audio output. | |||||
|
|
||||||
| #### Inapplicable Example 3 | ||||||
|
|
||||||
| This `video` element does not play for longer than 3 seconds. | ||||||
|
|
||||||
| ```html | ||||||
| <video autoplay> | ||||||
| <source src="/test-assets/rabbit-video/video.mp4#t=8,10" type="video/mp4" /> | ||||||
| <source src="/test-assets/rabbit-video/video.webm#t=8,10" type="video/webm" /> | ||||||
|
Comment on lines
+184
to
+189
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one's actually kind of tricky. The media resource has a duration of 13 seconds, but the video has a play time of 2 seconds. I think we'll need to update the applicability. Something like: @Jym77 WDYT?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, good point. Maybe phrasing the second sentence a bit more generically and with a link to specs: |
||||||
| </video> | ||||||
| ``` | ||||||
|
|
||||||
| #### Inapplicable Example 4 | ||||||
|
|
||||||
| This `video` element autoplays but is paused. | ||||||
|
|
||||||
| ```html | ||||||
| <video id="paused" autoplay> | ||||||
| <source src="/test-assets/rabbit-video/video.mp4" type="video/mp4" /> | ||||||
| <source src="/test-assets/rabbit-video/video.webm" type="video/webm" /> | ||||||
| </video> | ||||||
|
|
||||||
| <script> | ||||||
| document.getElementById('paused').pause(); | ||||||
| </script> | ||||||
| ``` | ||||||
|
|
||||||
| #### Inapplicable Example 5 | ||||||
|
|
||||||
| This `video` element does not play automatically. | ||||||
|
|
||||||
| ```html | ||||||
| <video> | ||||||
| <source src="/test-assets/rabbit-video/video.mp4" type="video/mp4" /> | ||||||
| <source src="/test-assets/rabbit-video/video.webm" type="video/webm" /> | ||||||
| </video> | ||||||
| ``` | ||||||
|
|
||||||
| #### Inapplicable Example 6 | ||||||
|
|
||||||
| This `audio` element does not play automatically. | ||||||
|
|
||||||
| ```html | ||||||
|
|
@@ -202,4 +228,4 @@ This `audio` element does not play automatically. | |||||
| [instrument]: #instrument-to-achieve-an-objective 'Definition of Instrument to Achieve an Objective' | ||||||
| [media resource]: https://html.spec.whatwg.org/multipage/media.html#media-resource 'HTML Specification of Media Resource' | ||||||
| [sc142]: https://www.w3.org/TR/WCAG22/#audio-control 'Success Criterion 1.4.2 Audio Control' | ||||||
| [web page]: #web-page-html 'Definition of HTML web page' | ||||||
| [web page]: #web-page-html 'Definition of HTML web page' | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is incorrect. In the context of:
If we only consider videos with a play time of < 3s, the SC would always pass by default.
Instead, I believe we should consider: