Helo.
I am building an application for kids using Phonegap.
On Android I have the following problem: I have a sellection of animations and I want to play it. BUT I do not want kids to go on youtube and be able to pick another video from youtube suggestions, nor I want them to be able to search a video (because of potentially unsafe content and because this will divert their attention from the lesson we are teaching).
A solution would be phonegap video plugin from Simon MacDonald BUT it gets me out of my app and into youtube with freedom for kids to choose any video or search, which could be dangerous and counterproductive. Maybe there are some yutube app parameters I can call in order to inhibit suggestions and searching and gracefuly returning in my app once video ended? On his blog ( http://simonmacdonald.blogspot.com/2011/11/video-player-plugin-for-phonegap.html ), Simon MacDonald said it could be easier somehow to embed youtube in webview once phonegap 1.5 is released, but I do not know how… (“We are working on an update to PhoneGap for late February which will allow you to embedded PhoneGap into your Android app. This way you can have two (or more) views in the same activity 1 is the PhoneGap view and the other is whatever you want and in your case a VideoView. So, in summary we can’t do it right now but the capabilities are coming.”)
Another sollution could be to emmbed the youtube video in a webview inside my app, but I am not sure how to do it, since html5 video or youtube iframe does not work in most android versions.
What could be the sollution?
Thank you. 🙂
One thing I wasn’t clear on that I’m assuming for this answer: You don’t want to wait for the phonegap update and will try other solutions not involving phonegap.
So your content IS uploaded/streamed by Youtube?
If so, please see: http://android-coding.blogspot.ca/2011/03/simple-example-using-videoview-to-play.html to play videos.
If not, you can convert the video to h264 (Google FFMPEG) and put this file on the external storage and point MediaPlayer or VideoView (MediaPlayer wrapper for non fullscreen) to this file.
It seems like you only need two real display states ((select an animation) AND (play an animation)). To simplify things if you’re not experienced with Android: try having a look at ViewSwitcher. This allows you two have to parent layouts (that can be used as your display states) in one xml and change them programmatically.
ViewSwitcher: http://inphamousdevelopment.wordpress.com/2010/10/11/using-a-viewswitcher-in-your-android-xml-layouts/
ViewSwitcher: http://developer.android.com/reference/android/widget/ViewSwitcher.html