Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap Camera Control

As far as I can tell the Phonegap API has a couple of options to for capturing a picture, but they all 'launch' the phones camera and then return to the app with the path to the captured image.

Is it possible to display the camera stream in a control on a page in an app so the image is captured 'within the app'? E.g. like Instagram, the user is not taken out of the app to capture the image i.e I require custom camera to be opened in a part of my current application page only.

If this is accomplished with a plugin, is there an existing third party plugin for Custom Camera or would I need to write this myself?

I REALLY like the whole idea of Phonegap, especially with Phonegap Build (awesome) but if I can't get this kind of functionality I'm going to have to go native :-(

Thanks in advance!

like image 916
wallismark Avatar asked May 05 '13 23:05

wallismark


People also ask

What is camera plugin?

Details. A plugin that enables an application to access the camera features of the user's device. This plugin allows the implementation of actions for taking pictures or choosing images from the device gallery.

What is camera plugin in Cordova?

This plugin defines a global navigator. camera object, which provides an API for taking pictures and for choosing images from the system's image library. Although the object is attached to the global scoped navigator , it is not available until after the deviceready event.

What are Cordova plugins?

Cordova Plugins A plugin is a bit of add-on code that provides JavaScript interface to native components. They allow your app to use native device capabilities beyond what is available to pure web apps.


1 Answers

I needed the same 'live camera view' for my augmented reality (AR) application. Phonegap does indeed not offer a live camera view yet. Therefore, I am using a Wikitude plugin for Phonegap.

Although Wikitude is an AR SDK, the basic functionality it offers is that exact camera live view.

How it works? You define a 'world', which is a basic HTML page. Once loaded, the background of this webpage will be your camera live view. In this webpage, you can still run PhoneGap Javascript code. You can call this 'world' whenever you want from your PhoneGap code.

Where to start You can get the PhoneGap plugin from https://github.com/Wikitude/wikitude-phonegap. Setup instructions and example projects are included. There is an unlimited trial of the Wikitude SDK available, you will need that as well.

like image 118
Caroline Avatar answered Dec 11 '22 02:12

Caroline