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

Stop dictate if microphone is not available #2517

Merged
merged 2 commits into from
Oct 30, 2019

Conversation

compulim
Copy link
Contributor

Fixes #2516.

Changelog Entry

  • Fixes #2516. Disable microphone input for expecting input hint on Safari, by @compulim in PR #2517

Description

Safari block microphone access if the code was not executed based on an user interaction.

We can check if we have access to microphone (see #2516). But the microphone check will result in an non-user interaction code, thus, code executed after the check will be blocked for microphone access.

In this PR, we are turning on microphone and checking access at the same time. If access is not granted, we will turn off microphone.

Specific Changes

  • Modify Dictation.js
    • When microphone access is required, it will do both simultaneously
      • Continue to open microphone
      • Check if microphone access is allowed
    • If microphone access is not allowed, we will close microphone

  • Testing Added
    • No tests are added because the specific route only repro on Safari

@coveralls
Copy link

coveralls commented Oct 30, 2019

Coverage Status

Coverage increased (+0.04%) to 63.473% when pulling 5e49112 on compulim:fix-detect-audiocontext into 0b9187f on microsoft:master.

@corinagum corinagum merged commit 69b4a13 into microsoft:master Oct 30, 2019
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.

Safari: Expecting input hint should not block microphone access
3 participants