Question about access to camera using media upload form in inappbrowser. Does anyone know a way of a

2,001 views
Skip to first unread message

Chris Barton

unread,
Mar 7, 2014, 8:22:06 AM3/7/14
to phon...@googlegroups.com
I have the inappbrowser working fine but when I use a media input it only allows gallery as an option on the Android device, I am wondering if there is a way to allow it to be the same as if it were using the browser so it has the option to upload from the camera.

Any ideas would be greatly appreciated.

Chris,

Rahul

unread,
Mar 10, 2014, 2:06:24 AM3/10/14
to phon...@googlegroups.com
Hello Chris,

Use this for image - 
<input type="file" accept="image/*" capture>

For Video - 

<input type="file" accept="video/*" capture>

For Audio -

<input type="file" accept="audio/*" capture>


Rahul

unread,
Mar 10, 2014, 2:08:31 AM3/10/14
to phon...@googlegroups.com
I pressed Post before writing this

You can also use it this like - 

<input type="file" accept="image/*" capture="camera">
<input type="file" accept="video/*" capture="camcorder">
<input type="file" accept="audio/*" capture="microphone">

Chris Barton

unread,
Mar 14, 2014, 6:22:38 AM3/14/14
to phon...@googlegroups.com
Thanks very much for the suggestions. This doesn't work in the inappbrowser, I tried 3 different inputs but it doesn't have camera as an option.

I tried:
                    <input style="font-size:20px;height:80px;" type="file" class="" name="userfile" size="20" accept="image/*" capture="camera" />

                    <input type="file" accept="image/*" capture>
                    <input type="file" accept="image/*" capture="camera">   

I have attached an image of the input options. It works with the normal browser but not using the phonegap app with inappbrowser. I am wondering if it's a permissions thing where the app can't access the camera.

Any thoughts?

Chris,
WP_20140314_001.jpg

jcesarmobile

unread,
Mar 14, 2014, 6:48:47 AM3/14/14
to phon...@googlegroups.com
input type file is broken on android 4.4 webview, so it's better not to use it on your app.

inAppBrowser is for external webs, you shouldn't care if things work there or not, if the web with the input is yours, you should try to integrate it inside the app instead using inAppBrowser to show it

Chris Barton

unread,
Mar 14, 2014, 7:00:28 AM3/14/14
to phon...@googlegroups.com
Thanks for the suggestion. Really all the app does is open a window in which I run a site. It's for a project where the software is cloud based on the web and I just want the pad user to use it. But because there is not a good lock down facility on the pad then the quickest way I thought would be to create a simple app that just loaded the website inside the frame.

It all works fine apart from the media upload, which works fine in the normal android browser but in the inappbrowser it doesn't allow the camera to be selected.

Any more suggestions at all?

Chris,

Chris Barton

unread,
May 3, 2014, 10:11:21 AM5/3/14
to phon...@googlegroups.com
Also, this demo doesn't work http://www.purplesquirrels.com.au/blogstuff/webcam/cam.html so think that it's a permission thing.

Anyone done that before?

Chris,

jcesarmobile

unread,
May 3, 2014, 10:38:10 AM5/3/14
to phon...@googlegroups.com
The input file on phonegap android is a "hack", there is some java code to launch an intent when you push de input file and the camera isn't called with that intent.
Why don't you just use the phonegap camera API?

alok....@clariontechnologies.co.in

unread,
Jul 21, 2015, 2:53:13 PM7/21/15
to phon...@googlegroups.com
Hello Chris,

I am working with cordova inappBrowser and complete website is working good, but when I use media input it is not even allowing gallery as a option on Android device.
No event is getting triggered when I click choose button.

As you have tested and you can see at least gallery as an option, I need some suggestions what permissions you used or what syntax you followed.

Thanks in advance..

Jesse Monroy

unread,
Jul 21, 2015, 6:00:15 PM7/21/15
to phonegap
@alok,
This thread is over a year old. Please start new threads when you have a problem. Do not
restart old threads.

When you use the inAppBrowser, you loose access to the phonegap device library.

Google: phonegap tutorial inappbrowser

Implementing inAppBrowser into a Cordova PhoneGap Project (Android)
https://iphonedevlog.wordpress.com/2013/06/27/implementing-inappbrowser-into-a-cordova-phonegap-project/

Jesse
Reply all
Reply to author
Forward
0 new messages