How to open phone camera in reactjs - reactjs

I am using 'react-webcam' component in my application. For web it is working for me but in mobile device it is not working. And My client needs that he immediately get to the phone's camera if he click take camera button in mobile device. please anyone help me to fix this issue
Thanks

There is an rpm package which can be used to open the camera. I have not used this yet.
Just try yourself.
npm package
Thanks

As mentioned here, Your service should be served secure, either from localhost or an https connection.
AND in ios>=11 Apple restricts WebRTC to Safari only!

Related

React twiliio programmable video switch camera is not working

I use "twilio-video": "^2.8.0" for building a video chat app. On mobile devices chat app should be able to switch the camera front and back.
I try something like this to the video track
tracks.restart({ facingMode: 'environment' })
But If I console log the tracks. There is no method called restart. Why would this happen?
Any help!
Thanks in adcanced. =)
Twilio developer evangelist here.
Can you upgrade to 2.9.0? I just tested with 2.8.0 and it didn't work, but 2.9.0 had the restart function.

[JsQR]Cannot access the camera on a mobile from chrome

I am on iPhone and it cannot access the camera from chrome. Is there any solution?
Error Message: "Unable to access video stream (Please make sure you have a webcam enable)"
source code "https://github.com/cozmo/jsQR"
Demo (I copied the same code from Author's demo)
This problem solved itself in an update of chrome. FINALLY! Safari is still better because It allows the user to save the setting and it never asks about the camera again for that particular url. Using QR codes in the browsers has allowed me to write "apps" in a browser and avoid the red tape of the big tech app stores.

iOS11 getUserMedia with apple web-app not working

Edit: Duplicate of How to access camera on iOS11 home screen web app?
I'm running into a problem with using a apple web-app together with camera access through the getUserMedia API.
I have some application that is working fine when accessed through safari, it asks for persmission to use the camera and upon approval I can see the camera feed. But if I save this same page to the home screen as an web-app this does not work anymore. There is no prompt for camera access, which seems to be the problem as it is not enabled by default.
The line that gives the problems is a meta tag which enables full screen for a web application on iOS.
<meta name="apple-mobile-web-app-capable" content="yes">
Anyone know what is going on here and why this fails? Do I need to set camera permission somehow through a meta tag also?
Thanks in advance!
Apple has removed the ability to use getUserMedia inside a UIWebView, WKWebView, SFSafariViewController, or a webpage that has been "added to the home screen".
The reasoning is not clear, however I do not believe this to be a bug.
An Apple staff member wrote this about WebRTC in iOS 11:
...right now, WebRTC is only supported in Safari. No WKWebView, not even SFSafariViewController.
And I can confirm that this includes the UIWebView as well (through personal tesing).
The navigator.mediaDevices.getUserMedia function is back in iOS 14.3 which got out yesterday. (Make sure you are not using the navigator.getUserMedia which is deprecated).
We'll be using it in Cordova, I'll update this post if we find some instabilities.
Don't forget to use the playinline attribute in your <video> element if you don't want the video to start in fullscreen.

Images on mobile devices are blurry when using 4G

I noticed my images on a website are blurry when using a mobile device. This occurs only when I'm using 4G and NOT when I'm connected to wi-fi. If I'm connected to wi-fi, the images look fine.
I realize a slower connection may be causing this, but I'm curious how I can fix it. I downloaded a "Resize Image Quality" plugin for Wordpress and that didn't work.
Are there any changes that can be made to CSS to fix this issue? I'm never had this issue before with Wordpress or any other CMS.
Here's a link just in case it's needed: http://bit.ly/1J1vwFB
That's weird, I used chrome with network throttling and emulating different phones.. It looks fine, have you tried other phones?

SMS , flashlight, vibrate not working on codename one android build

I have made an android app using codename one
I tried the following with codename one:
1) Display.getInstance().flashBacklight(10);
2)Display.getInstance().vibrate(100);
3)Display.getInstance().sendsms();
All these API worked properly for the J2me build.
However, for android none of them worked. Why could this be happening? I tried it on motorolla atrix 2.
flashBacklight isn't supported on Android, if I remember correctly that functionality wasn't available on older Android versions it might be available now. You can file an issue on that and we can look into it again.
Vibrate should work its possible vibration was disabled on that specific device but I haven't tried it. You can file an issue on that as well and we can have a look.
Send SMS works for me, it opens up the SMS intent on Android and passes the text/number to which the SMS should be sent. This is different behavior than the J2ME version of sending SMS.

Resources