-
Notifications
You must be signed in to change notification settings - Fork 76
Replacing non-streaming audio with live audio #1661
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
ab1c358
ee235af
7d3d563
247d607
747fce7
029a4a6
712fc60
122254b
04f15fa
b8421b8
2d300b5
cee32c0
bf23852
42031c6
7865622
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 |
---|---|---|
@@ -0,0 +1,140 @@ | ||
--- | ||
id: 213x3x | ||
name: '`audio` element plays live content' | ||
rule_type: atomic | ||
description: | | ||
This rule checks the content played by an `audio` element is live | ||
accessibility_requirements: | ||
input_aspects: | ||
- DOM Tree | ||
- CSS Styling | ||
- Audio output | ||
acknowledgments: | ||
authors: | ||
- Carlos Duarte | ||
--- | ||
|
||
## Applicability | ||
|
||
This rule applies to every `audio` element that is: | ||
|
||
- playing; or, | ||
- has a [play button][] that is [visible][] and [included in the accessibility tree][]. | ||
|
||
## Expectation | ||
|
||
For each test target at least one of the following is true: | ||
|
||
- the target element's [media resource][] is not [seekable][]; or | ||
- after [seeking][seek] the end of the target element's [media resource][] the [current playback position][] is not the end of the target element's [media resource][]. | ||
|
||
## Assumptions | ||
|
||
_No assumptions._ | ||
|
||
## Accessibility Support | ||
|
||
There are no major accessibility support issues known for this rule. | ||
|
||
## Background | ||
|
||
- [Understanding SC 1.2.1:Audio-only and Video-only (Prerecorded)](https://www.w3.org/WAI/WCAG21/Understanding/audio-only-and-video-only-prerecorded) | ||
|
||
## Test Cases | ||
|
||
### Passed | ||
|
||
#### Passed Example 1 | ||
|
||
This `audio` element plays a live media resource by streaming the audio from the device's microphone. The [media resource][] is a MediaStream which is not [seekable][]. | ||
|
||
Test instructions: | ||
|
||
- Load the test case in a browser supporting the experimental MediaStreamTrack API (You can successfully test this example on Google Chrome with the flag --enable-blink-features=WebCodecs,MediaStreamInsertableStreams); | ||
- Authorize the browser to access a microphone. | ||
|
||
```html | ||
<html lang="en"> | ||
<p> | ||
This example requires a browser supporting the experimental MediaStreamTrack API. The browser must be authorized to | ||
access a microphone. You can successfully test this example on Google Chrome with the flag | ||
--enable-blink-features=WebCodecs,MediaStreamInsertableStreams | ||
</p> | ||
|
||
<p id="vLog"></p> | ||
<audio controls autoplay></audio> | ||
|
||
<script> | ||
const log = document.querySelector('#vLog') | ||
|
||
document.addEventListener( | ||
'DOMContentLoaded', | ||
function(event) { | ||
if (typeof MediaStreamTrackProcessor === 'undefined' || typeof MediaStreamTrackGenerator === 'undefined') { | ||
log.innerHTML = | ||
'Your browser does not support the experimental MediaStreamTrack API. ' + | ||
'Please launch with the --enable-blink-features=WebCodecs,MediaStreamInsertableStreams flag' | ||
return | ||
} | ||
|
||
const constraints = { | ||
audio: true, | ||
video: false, | ||
} | ||
|
||
navigator.mediaDevices | ||
.getUserMedia(constraints) | ||
.then(function(mediaStream) { | ||
document.querySelector('audio').srcObject = mediaStream | ||
}) | ||
.catch(function(err) { | ||
log.innerHTML += err.name + ': ' + err.message | ||
}) | ||
}, | ||
false | ||
) | ||
</script> | ||
</html> | ||
``` | ||
|
||
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. I am assuming we are expanding these passed examples with real streaming audios/videos of broadcasting orgs, right? 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. That was the main idea. As was also mentioned in TPAC, we might want to explore the possibility of W3C hosting a streaming server where we could serve the examples (we would just loop one of the videos we already use). |
||
### Failed | ||
|
||
#### Failed Example 1 | ||
|
||
This `audio` element plays a recorded media resource. | ||
|
||
```html | ||
<html lang="en"> | ||
<audio src="/test-assets/moon-audio/moon-speech.mp3" controls></audio> | ||
</html> | ||
``` | ||
|
||
### Inapplicable | ||
|
||
#### Inapplicable Example 1 | ||
|
||
This `audio` element's controls are not [visible][] on the page. | ||
|
||
```html | ||
<html lang="en"> | ||
<audio src="/test-assets/moon-audio/moon-speech.mp3" controls style="display: none;"></audio> | ||
</html> | ||
``` | ||
|
||
#### Inapplicable Example 2 | ||
|
||
This `audio` element does not have controls. | ||
|
||
```html | ||
<html lang="en"> | ||
<audio src="/test-assets/moon-audio/moon-speech.mp3"></audio> | ||
</html> | ||
``` | ||
|
||
[current playback position]: https://html.spec.whatwg.org/multipage/media.html#current-playback-position | ||
[included in the accessibility tree]: #included-in-the-accessibility-tree 'Definition of included in the accessibility tree' | ||
[media resource]: https://html.spec.whatwg.org/multipage/media.html#media-resource | ||
[play button]: #play-button | ||
[seek]: https://html.spec.whatwg.org/multipage/media.html#dom-media-seek | ||
[seekable]: https://html.spec.whatwg.org/multipage/media.html#dom-media-seekable | ||
[visible]: #visible 'Definition of visible' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: Play button | ||
key: play-button | ||
unambiguous: true | ||
objective: false | ||
--- | ||
|
||
A play button is an [instrument][] that when [activated][] plays a [media resource][]. | ||
|
||
[activated]: https://html.spec.whatwg.org/#activation | ||
[instrument]: #instrument-to-achieve-an-objective | ||
[media resource]: https://html.spec.whatwg.org/multipage/media.html#media-resource |
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.
There are many SC about pre recorded media. We should list all or none (or maybe you plan to add the rest when the atomic rule is added to the other composites)
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 think I'll address this one after sorting out this rule.