Access mobile microphone with navigator.getUserMedia (Javascript) - javascript

building an open source app, and I released the desktop version (dmeowmixer.github.io/voicetrainer) but when I load it in mobile (my phone uses android browser) and click the button to prompt for access to users microphone input it alerts that navigator.getUserMedia isn't supported. I read somewhere that it was supported in previous version of android browser but I'm not too sure. Could someone shed some light on if this will be possible to do in mobile without making a completely new application?
https://github.com/Dmeowmixer/voiceTrainer link to repo

Firstly make sure that your android browser is supporting getusermedia. You could use the link below to check it out. http://caniuse.com/#feat=stream. If it is not supported on a browser, i don't think you can do much about it.
Check The stream provided works differently in different browsers answer to make sure you are doing the right thing how to make getUserMedia() work on all browsers if it is supportd by it!

Related

iOS Browsers except Safari Keeps asking camera permission every time I load the page

We are currently developing a qr code scanning system using laravel but when I test it on Chrome or other browser except Safari, it always ask camera permission.
I have already allow camera permission on browser setting on my iPad. Is there other way to permanently allow it or only ask once on Chrome browser like on android that remembers my choice? Or is it possible to do it programmatically like using Javascript?
thank you so much! I really need everyone's help, I couldn't find any related topics on the internet about this 😄
There is no API for the PWA's to change it from "Ask" to "Allow". There is an issue on WebKit around this: https://bugs.webkit.org/show_bug.cgi?id=215884, but what can you do is to change it manually in browser settings, as it was mentioned: https://stackoverflow.com/a/57368061/615393.

How to open Safari browser from any other browser in javascript?

I'm working on the core Php(PHP + bootstrap + jquery) website and I want to open the safari browser from any browser with a special URL.
IOS users are using many kinds of web browsers but my site is working on the only safari with ios users.
So when IOS users call a special URL, the safari browser should open with this URL.
I think I may use javascript functions.
Please let me know if you have any good solutions.
Best Regards.
You can't.
JavaScript does not have that kind of access to your system.

Flash On Chrome OS

I have an Chrome app for Chrome OS that lets you run SWF files offline. The problem is when I use
<object data="flashFile.swf"></object>
It says that flash is blocked. I went to flash section in my settings and I see the apps that can and/or can't use flash but can't seem to be able to enable flash for my app. It also says it's enforced by an extension but I have no idea which one. Any suggestions?
(the picture below is a screenshot of the problem I am having)
I have a simple trick that will bring up an alert asking the user to allow flash on the website: Enable Flash Player
This is guaranteed to work on Chrome, and works on Chrome OS but I'm not sure of other browsers or OSes, anyway, hope this helps. I myself have experienced the annoyances of the new default settings; they make it much harder to run flash!
After all this time I finally figured it out. In order to use flash in a chrome app you must copy the apps id, go to settings --> content settings --> flash and click the "add" button next to "allow" and then paste the apps id as the site.

Android Chrome Website

Guys I build a website and when i am accessing it from the android browser(Default) A script that is very important on the functionality of my website is not being displayed. But when I am accessing it from the android google chrome browser the script is being displayed as I was expected to see.
My site is responsive, it adapted to the screen of the user.
I am using galaxy note 2 and the android version is 4.3.
I was thinking to build an android application such as a browser that is going to be always fullscreen and locked on my site but i do not what google chrome browser has and making my website as I want it to be.
Any help?
I'm not sure what you mean by Android Browser (default). Is there a Samsung Browser already preinstalled on the phone that isn't Chrome?
My guess, off the top of my head, is that JavaScript is disabled on this other browser. If you were to create your own browser with an Android WebView, JavaScript is disabled by default and must be manually set to true.
A quick Google search for 'Samsung Note JavaScript' doesn't return anything readily apparent, but here are a few different Samsung Models with directions on how to enable JavaScript on their browsers. I would imagine the process is similar for the Note 2.
http://support.t-mobile.com/docs/DOC-6782
http://www.droidista.com/2014/06/enabledisable-javascript-on-samsung.html
http://www.att.com/esupport/article.jsp?sid=KB117209&cv=820#fbid=omMGs_GnNUf

Is there a way to capture images from Webcam?

Is there a way to capture images from a webcam with JavaScript?
Nope - think of the security implications!
It is possible with Flash, but the user will see a popup requesting access to their webcam.
If the webcam had a web interface, then in theory it would be possible to just slap an image tag into a page somewhere and point it directly at the cam's snapshot interface:
<img src="http://address.of.webcam.example.com/webcam/capture" />
But otherwise, no. Standard Javascript has no API for accessing a webcam. There's no
var wc = new WebCam();
img = wc.capture();
type calls you can do.
The situation has changed from when this question was originally posted. The getUserMedia API was introduced to allow things like capturing webcam images. You can find tutorials and plugins demonstrating it.
But MDN now says the Navigator.getUserMedia API is deprecated in favour of the experimental API MediaDevices.getUserMedia. The getUserMedia tutorials and plugins don't work on iOS devices - they just don't support it.
The answer at the moment seems to be that there is an HTML API for it, but browser support is patchy and the API is possibly on its way out. You can only use it in Firefox and IE Edge, and in Chrome only from an https domain.
I would like to revive this question and ask if anyone knows of any web API that will successfully capture webcam images in all major browsers and devices.

Categories