Open mobile camera by clicking a button through web browser - html

I want to open mobile camera when I clicked a button from browser. Below there is an image what i want to do.
This is an image what i have now
I can choose file from local and also want to add from camera.
<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="uploadedfile" accept="image/*" capture="camera">
<input type="submit" value="Upload">
</form>
I tried above code for opening camera and it is from How to access a mobile's camera from a web app? .
Now please help me to show camera on mobile through Browser.

With an input[type="file"] field you can pick a file, or ask the device to record a media. It will always open an app or a prompt to choose an app. If you want to stay in the browser you need to use the MediaStream Recording API but it is not fully supported yet. For now, it is not working in iOS so either way, you have to open up the default camera app.
If you want to take photos you can try the MediaStream Image Capture API. But it is still just an experimental technology which won't work in most of the current browsers.
You can find some examples here:
Taking still photos with WebRTC - MDN
ImageCapture.takePhoto - MDN
Take Photos and Control Camera Settings - Google developers
Access the camera interactively - Google developers
I hope the links above can help you

Related

PWA html5 open device camera as soon as page is launched

i have a pwa where i am showing a standard input tag like below. this let user tap on it and get access to device camera. However, i want to open the camera as sooon as you open the webpage. is it possible?
current code:
<input type="file" accept="image/x-png,image/jpeg,image/gif" capture="camera"/>
Like Mathias said access to the camera is gated behind user permission.
Instead of an input tag like you are using you should really use the Media Capture API.
You have to get the user's permission to access the camera first. Once you have that permission you can connect to the camera and capture photos and video.
Note: Apple has disabled access to camera from homescreen web apps. No idea when they will turn this on. You can access the camera from regular Safari on iOS, just not from a homescreen web app even though it is the same engine.

Change default language in iOS app

I am developing a hybrid iOS app in iOS 7 and PHP/HTML/JS. I have made a webviewer and therein I loaded my web-part of the app.
I have a photo uploader like this in HTML:
<input type="file" accept="image/*" capture="camera" />
If I tap the button, iOS show me three default options:
1) Take Photo
2) Choose Existing
3) Cancel
All these options are in English. Is it possible to set those to Dutch?
So, is it possible to change a sort of app language?
If you localize your application: http://www.raywenderlich.com/64401/internationalization-tutorial-for-ios-2014, and change your iPhone language settings to Dutch, (Settings->General->International->Language), then those options will be shown in Dutch.

Adding an image to a responsive website that sends it to an SQL database

I'm stuck with something. We have made a project in school but we aren't passed so now we have to improve it. The project consists of controlling situations and events of a city. It is meant for smartphones but we don't know any mobile programming language yet so we can write it in html and javascript. We also can use JSON and AJAX to "talk" with our back-end. Example : there is a hole in the road, so i want to add this situation and i'm able to give details, it automatically gets the location by google maps.
So now to the point, there is a page called add.html, on this page i can add events or situations with all the details. We have everything but we are stuck with the image part. We need to be able to add an image to our database. Our website is responsive, i want to have an icon of a camera (so you can take a picture with your smartphone and add it, or you can choose from the pictures on your smartphone) that is a hyperlink to adding an image. So if you are on a pc or laptop it should open your browser where you can choose a picture from your hard drive, and elsewise like i said above. Does anyone has an idea how we need to approach this problem? Thanks a lot in advance!
Make your camera icon an input that looks like this:
<input type="file" accept="image/*" capture="camera">
This will launch the camera app in iphone iOS 6+ and android 3.0+.
There is a javascript API for navigator.getUserMedia(). This works in Chrome, Firefox and will work in IE 11. See
HTML5 Rocks: Tutorials: Capturing Audio & Video in HTML5 for details.

Kendo UI Mobile - Camera feature with HTML5 input tag responsiveness very slow

Implemented camera feature using HTML5 input tag.
Requires atleast 5 to 6 clicks before opening camera. Tried on iOS 6 Safari browser and Goggle chrome browser on Android.
Refered below js files :
1. jquery-1.8.3.js
2. kendo.mobile.min.js
Do we need to include any js file
Code :
<div data-role="view" id="tabstrip-camera" data-title="camera" data-layout="mobile-tabstrip" id="Camera">
<!--Camera Code-->
<input data-click="alert('clciked');" type="file" name="image" accept="image/*" capture>
</div>
Even when tried with simple HTML5 button tag the response is slow and same observation is used.
Please can any one help ? Do we need to include any js file.
Is your intent to deploy an actual mobile app to a phone or tablet device, or just to use Kendo Mobile widgets in a desktop web browser?
If you are going to deploy to a device, then you should be building on top of PhoneGap / Cordova, and could use PhoneGap's image capture function:
http://docs.phonegap.com/en/1.2.0/phonegap_camera_camera.md.html
Try upgrading to the Kendo UI Q3 service pack that was released this week and see if this fixes it.
The original Kendo UI Q3 release had some issues with the touch/mouse events due to the major change we did in event handling in order to support systems with both mouse and touch (Chrome/FF on Windows 8).

HTML5 Voice Input mic access

How does the HTML5 Voice input on Chrome (Mac) get access to the mic? Is it because I have the google voice plugin installed?
Shouldn't the browser explicitly ask for permission before giving access?
http://slides.html5rocks.com/#speech-input
The microphone isn't directly being exposed to the Web pageā€”it's just posting the speech (and receiving text) through Google servers so it's not considered a security issue (and you have to click the microphone icon to start it). It's pretty similar to how voice input works on Android and Google's iPhone/Blackberry apps.
It is explicitly asking permission before giving access, that's what clicking the microphone icon is.
Think of it more like the <input type="file"> element -- you click "Browse", it shows you your file system, and the browser sends the selected file directly to the server.
For those saying that you can't style the button and it can't be exploited - it was done with Facebook like buttons - http://www.esrun.co.uk/blog/disguising-a-facebook-like-link/
So what's to stop it working for the Google Mic button?