1

i'm beginner in phnegap. while searching easy testing tool for phonegap i found appmobi xdk for desktop and app.lab for mobile. it looks easy to work with it. but when i tried to run some phonegap functions like:

 function captureVideo() {
    // Launch device video recording application, 
    // allowing user to capture up to 2 video clips
    navigator.device.capture.captureVideo(captureSuccess, captureError, {limit: 2});
 }

etc. it throws and error "can't read property 'capture' of undefined". i'v set the

<script src="phonegap.js"></script> 

inside head tag but no luck. when i tried it with phonegap build in https://build.phonegap.com/apps. it works fine.

i'm bit confused here. is XDK and app.lab are just for testing html5 apps or it supports phonegap features too like notification, camera, capture etc.

Thanks !

krozero
  • 5,929
  • 3
  • 21
  • 33

1 Answers1

0

I ran in the same issue times ago. Depending on your configuration device or capture is the undefined object. You have to add the Device, Capture and Camera plugins.

If you are using intel xdk you can set them by going to the project view -> plugin and permissions

see: https://github.com/apache/cordova-plugin-media-capture/blob/master/doc/index.md

Paizo
  • 3,986
  • 30
  • 45