I am running the app on ios 9.2 via PhoneGap Desktop.
I have just started out using PhoneGap and I am trying to build a simple app that allows you to take a picture and show it back to you. I have been able to do this using the cordova camera plugin that launches the camera app on the device. however I would like to implement the app that launches a full screen camera as soon as the device is ready, just like snapchat.
I have been trying to do this using the CanvasCamera Plugin by Donald Pae https://github.com/donaldp24/CanvasCameraPlugin
But still I have had NO success in getting the camera preview.
I have installed the plugin via npm using gitbash
I have added the plugin to the config.xml file
<gap:plugin name="com.keith.cordova.plugin.canvascamera" version="1.0.1" />
This is the code that I am using to try and get a camera preview
HTML
<canvas id="camera" width="352" height="288" style="border:2px solid black"></canvas>
index.js Inside the bind events function
document.addEventListener("deviceready", function() {
canvasMain = document.getElementById("camera");
window.plugin.CanvasCamera.initialize(canvasMain);
// define options
var opt = {
quality: 75,
destinationType: CanvasCamera.DestinationType.DATA_URL,
encodingType: CanvasCamera.EncodingType.JPEG,
saveToPhotoAlbum:true,
correctOrientation:true,
width:640,
height:480
};
window.plugin.CanvasCamera.start(opt);
});
I really appreciate your help.
thanks