I'm using the videoPlayer plugin
(https://github.com/phonegap/phonegap-plugins/tree/master/Android/VideoPlayer)
to play video from PhoneGap. Even though it makes a call to an
external app, my phoneGap app is still running in the background, so
any accelerometer triggers are still going on -- sounds play, other
videos will get launched -- etc -- not good. What I want is to STOP
listening for accelerometer while the video is playing, and START
listening again when the video stops.
It should be notes that after a video is done playing, we
automatically return to our PhoneGap app -- great! But I can't figure
out how to use this return to get the accelerometer to start listening
again.
When I call my playVideo() function, I can just write:
navigator.accelerometer.clearWatch(watchID);
But where do I put watchID =
navigator.accelerometer.watchAcceleration(onSuccess, onError,
options)????
Thanks,
Justin