Reputation: 136
Hi i need to connect to http without security issues... this is the link http://audior.ec/recordmp3js/ when open with chrome it shows the problem but not with firefox
browser.Source = "http://audior.ec/recordmp3js/";
this is the log from the website if it work "firefox": Audio context set up. navigator.getUserMedia available. Media stream created. input sample rate 48000 Input connected to audio context destination. Recorder initialised.
and this one if not working "chrome":
No live audio input: SecurityError: Only secure origins are allowed (see: https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features).
Upvotes: 1
Views: 920
Reputation: 17658
As chrome states:
No live audio input: SecurityError: Only secure origins are allowed (see: https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features).
This means you need a secure https
connection when you want to use your microphone in chrome.
This is a security measure which needs to be implemented at your sever.
You could use a certificate authority to get one (like Lets Encrypt (it's free)) or use a self signed certificate. Although the latter might not work since it's not always considered to be secure
The reason why it works in firefox is because they don't seem to have chosen for such a restriction. This could change in the future.
New Webviews also share the same rendering engine as Chrome for Android, so rendering should be much more consistent between the WebView and Chrome.
See Android Webview. I am pretty sure Xamarin uses this implementation.
At the time of writing, these are considered to be secure origins (see link)
“Secure origins” are origins that match at least one of the following (scheme, host, port) patterns:
(https, *, *)
(wss, *, *)
(*, localhost, *)
(*, 127/8, *)
(*, ::1/128, *)
(file, *, —)
(chrome-extension, *, —)
Upvotes: 1