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

Add "not-allowed" error code to SpeechSynthesis #28

Merged
merged 2 commits into from
Aug 9, 2018

Conversation

csharrison
Copy link
Contributor

@csharrison csharrison commented Jul 30, 2018

This error is designed to be analogous to

  1. https://webaudio.github.io/web-audio-api/#allowed-to-start
  2. https://html.spec.whatwg.org/multipage/media.html#allowed-to-play

This leaves it up to the user agent if speaking should be allowed or not.


Preview | Diff

@csharrison
Copy link
Contributor Author

@minorninth @mounirlamouri @foolip FYI

The existing text to this spec do not really formalize when these errors will be fired. I could add a section to the "speak" section if it adds clarity.

Dominic also suggested offline to spell this like "needs-user-interaction" but I preferred to keep this in line with WebAudio / Media and leave it open to the UA to decide when speech is allowed.

@foolip
Copy link
Member

foolip commented Aug 6, 2018

@csharrison these changes LGTM. I'd like to see this tested in web-platform-tests as well. Web Audio and HTML don't say anything normative about when playback should be refused, but I'd be happy to see it spelled out normatively in https://w3c.github.io/speech-api/#dom-speechsynthesis-speak. As you can see the prose in this spec isn't algorithmic or too precise, but if you can reference https://html.spec.whatwg.org/multipage/interaction.html#triggered-by-user-activation and "not-allowed" in the same sentence, that'd be enough to write a test for it. Would you mind doing that? Thanks!

@csharrison
Copy link
Contributor Author

@mounirlamouri Can you give any more historical context for why neither WebAudio / HTML specs spell out when playback should be refused? My fear is that this was chosen for a good reason, and that we should be cautious when diverging from the status quo.

@csharrison
Copy link
Contributor Author

I've written some WPT that exercise this error path in web-platform-tests/wpt#12327

@mounirlamouri
Copy link

The rules for autoplay vary between browsers and as of today, I do not think any two browser follow the same set of rules. Because the rules to set autoplay are deeply related to the expected user experience, we have left them as "user agent details" for now. The hope is that we will converge to a set of rule we all agree on.

@csharrison
Copy link
Contributor Author

Thanks! @foolip, let me know if you still want the normative changes applied here given the context in #28 (comment).

@foolip
Copy link
Member

foolip commented Aug 7, 2018

@mounirlamouri are there tracking issues for converging on the conditions for when autoplay shouldn't work, i.e. the bits that would be required to be able to have a test that asserts that playback fails video.play() (or equivalent) is simply called from script?

@csharrison, how about filing an issue in this repo to define the precise condition, link that to any other similar issues in HTML / Web Audio, and then making the failure test in web-platform-tests/wpt#12327 tentative?

@foolip foolip merged commit 544ed7c into WICG:master Aug 9, 2018
@foolip
Copy link
Member

foolip commented Aug 9, 2018

Spec and test changes merged, thanks @csharrison!

foolip pushed a commit to web-platform-tests/wpt that referenced this pull request Aug 9, 2018
@mounirlamouri
Copy link

@foolip my plan was to discuss this with other browsers are TPAC and whether we could start an "autoplay" spec that could try to put into spec word some of the logic. Nothing more than this idea exist at the moment :)

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Aug 15, 2018
…n, a=testonly

Automatic update from web-platform-testsSpeechSynthesis.speak requires activation (#12327)

Follows WICG/speech-api#28.
--

wpt-commits: d79d572569f3fef976d8de893897ac7a52656bcd
wpt-pr: 12327
jankeromnes pushed a commit to jankeromnes/gecko that referenced this pull request Aug 15, 2018
…n, a=testonly

Automatic update from web-platform-testsSpeechSynthesis.speak requires activation (#12327)

Follows WICG/speech-api#28.
--

wpt-commits: d79d572569f3fef976d8de893897ac7a52656bcd
wpt-pr: 12327
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 3, 2019
…n, a=testonly

Automatic update from web-platform-testsSpeechSynthesis.speak requires activation (#12327)

Follows WICG/speech-api#28.
--

wpt-commits: d79d572569f3fef976d8de893897ac7a52656bcd
wpt-pr: 12327

UltraBlame original commit: 0af3cd1d119b4aca7292fe54ed0985fa9494bb58
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 3, 2019
…n, a=testonly

Automatic update from web-platform-testsSpeechSynthesis.speak requires activation (#12327)

Follows WICG/speech-api#28.
--

wpt-commits: d79d572569f3fef976d8de893897ac7a52656bcd
wpt-pr: 12327

UltraBlame original commit: 0af3cd1d119b4aca7292fe54ed0985fa9494bb58
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 3, 2019
…n, a=testonly

Automatic update from web-platform-testsSpeechSynthesis.speak requires activation (#12327)

Follows WICG/speech-api#28.
--

wpt-commits: d79d572569f3fef976d8de893897ac7a52656bcd
wpt-pr: 12327

UltraBlame original commit: 0af3cd1d119b4aca7292fe54ed0985fa9494bb58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants