[HELP] listening for callback from videoPlayer plugin?

24 views
Skip to first unread message

Justin Lange

unread,
Mar 6, 2012, 8:18:21 PM3/6/12
to mobileweb...@nyu.edu, Sean Montgomery
Hey Folks,

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

Sean Montgomery

unread,
Mar 7, 2012, 4:59:52 PM3/7/12
to Justin Lange, mobileweb...@nyu.edu
Hmm, tricky one. 
Short of digging into the plugin and adding a callback, could you use the pause and resume functions in the PhoneGap api? -  http://docs.phonegap.com/en/1.5.0/phonegap_events_events.md.html#Events 
-Sean
Reply all
Reply to author
Forward
0 new messages