-
-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
binding video events #2
Comments
I didn't build in any support for it. The way the plugin works is by starting a new intent so in actual fact you are in a separate app playing the video. Not quite sure how one would capture these events without pulling the video player into the current app and that'd be a bit of a pain to have to re-write the video player component that the OS provides. |
ya, i am trying to do that now and it's not going so well. here is what i am trying right now: private void playVideo2(String url) throws IOException {
// Create URI
// Create a new media player and set the listeners
DroidGap currentCtx = (DroidGap) this.cordova.getContext();
VideoView vd = currentCtx.getVideoView();
Uri uri = Uri.parse(url);
MediaController mc = new MediaController(this.cordova.getActivity());
vd.setMediaController(mc);
vd.setVideoURI(uri);
vd.start();
} VideoView needs to access R and I wasnt able to access that through the plugin so I am trying to go through the app class. I know it's seriously bad programming, but I just want to get the events to work for this app. Im not planning to release this back unless I can clean it up. Do you know of a way to access the R variable inside of a plugin? --jake |
The problem with trying to access R is that R is from a different package in each application. What do you need R for? |
the videoview needs it according to the examples i am finding. I had another idea. Could we use Broadcastreceiver to intercept the mediaplayer events from the intent? --jake |
Hi Simon,
How do you bind to events from the media player? If I wanted to find out when the video was finished or started or in the middle of playback, how would I capture those events?
In the logcat i can see that those events are there, but I'm having some trouble intercepting them.
Thanks
Jake
The text was updated successfully, but these errors were encountered: