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

Keeps on asking Media Permission #53

Closed
keshavagrawal89 opened this issue Sep 23, 2013 · 4 comments
Closed

Keeps on asking Media Permission #53

keshavagrawal89 opened this issue Sep 23, 2013 · 4 comments

Comments

@keshavagrawal89
Copy link

I don't know why its happening but I just plugged in the js file(I downloaded on github and hosted on my server and gave the path). When I reload my server page it keeps on asking the Media permission again and again and I keep on clicking "Allow" in chrome(Version 29.0.1547.65)

<html>
    <head>
        <title></title>
        <link rel="stylesheet" href="/site_media/css/style.css" type="text/css" />
        <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.1.9/jquery.form-validator.min.js"></script>
        <script type="text/javascript" src="/site_media/js/annyang.js"></script>
    <script type="text/javascript">
        if(annyang)
        {
            var commands = {
                'show tps report': function() {
                    console.log("You just said - Show tps report");
                }
            };

            annyang.debug();
            annyang.init(commands);
            annyang.start();
        }
    </script>
    </head>

    <body>
        <h1 style="text-align:center;"> Welcome </h1>
        <div class="page-wrap">
            <div id="navigation">
                <div class="hard-navigation">
                <a href="/report/">Report</a>
                </div>
            </div>
            <div class="content">

    <div>
        Hey There! I am brand new.
    </div>

            </div>
        </div>
    </body>

</html>
@keshavagrawal89
Copy link
Author

ok looks like my chrome browser was screwed but even now after some intervals its keeps on asking..may be after 20 seconds? Am I missing something in the docs?

@tychio
Copy link

tychio commented Sep 23, 2013

https://support.google.com/chrome/answer/2693767?p=ib_access_cam_mic&rd=1

  • "If you select Allow on a "http" URL your preference will not be remembered in future visits."

@TalAter
Copy link
Owner

TalAter commented Sep 23, 2013

Yes, there is an issue in Chrome that it sometimes just stops listening after a while for no reason... annyang handles this by restarting the SpeechRecognition as soon as it is stopped. Unfortunately Chrome will ask you for permission again each time... Unless you are using HTTPS.

This is why it's always recommended to use HTTPS with speech recognition.

Thanks for the help @tychio

@TalAter TalAter closed this as completed Sep 23, 2013
@TalAter
Copy link
Owner

TalAter commented Jan 15, 2014

This might also happen if you have more than one tab open using speech recognition at the same time, as only one instance of SpeechRecognition is allowed to listening at any time.

You might get the following condition happening

  1. Recognizer 1 will start.
  2. Recognizer 2 will start, stopping Recognizer 1.
  3. Recognizer 1 will attempt to restart, thus stopping Recognizer 2.
  4. goto 10

This might actually cause the browser to crash, but annyang has some logic to prevent it... I've also worked with the Chromium team, and they've solved the underlying issue which caused the crash.

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

No branches or pull requests

3 participants