Quantcast
Channel: Foren
Viewing all articles
Browse latest Browse all 170

generating a camera event

$
0
0

hi there,

I'm writing a cross-platform App with XDK new and am trying to generate an event to turn the camera off, but am having no luck.

The code is something like this:

    intel.xdk.camera.takePicture(70, false, "jpg");  turn camera on

    // set a timer using an interval 
    timerHandle = setInterval(function(){cameraStop();}, 10000);   // give the user 10s to take a picture

...

// if they haven't taken the picture after 10s, turn off the camera by generating a camera event

 

function cameraStop() {
    clearInterval(timerHandle);    // stop the timer

    var stopCameraEvent = document.createEvent("Events"); 

   stopCameraEvent.initEvent("intel.xdk.camera.picture.cancel", true, false);  // event type, bubbling and non-cancellable

    dispatchEvent(stopCameraEvent);       

}

 

Does anyone have any experience with turning off the camera and/or generating events from within XDK?  Please let me know any pointers, solutions, tips...  

 

thank you,

Terence

 

 

 


Viewing all articles
Browse latest Browse all 170

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>