Video Player for PhoneGap Android 2.2.0 or above
The video player allows you to play videos from your PhoneGap application.
Building applications for each device–iPhone, Android, Windows Mobile and more–requires different frameworks and languages. PhoneGap solves this by using standards-based web technologies to bridge web applications and mobile devices. ”
Download Phonegap from here: http://phonegap.com/install/
3. Download videoPlayer.java file.
4. Create package name as “src/com/phonegap/plugins/video” in your project
5. Move videoPlayer.java file to “src/com/phonegap/plugins/video” package.
4. In res/xml/plugins.xml file add couple of lines:
<plugin name="VideoPlayer" value="com.phonegap.plugins.video.VideoPlayer"/>
Working with index.html file
Create html file name as index.html file and add this method
Url parameter can be one of four types:
1. The file:// protocol to play something native to the device such as:
2. The http:// protocol to play something on the internet such as:
3. The http:// protocol pointing to a video on YouTube such as:
window.plugins.videoPlayer.play ("http://www.youtube.com/watch? v=E0UV5i5jY50");
4. The file:// protocol to play video from assets folder in your project.
Note: When playing video from the assets folder, the video is first copied to internal storage with MODE_WORLD_READABLE.
Well, I assuming that you have downloaded PhoneGap, replace your index.html file with existing index.html in assets folder. Your index.html file for android should be placed in a path which looks something like this:
Well, once having replaced index.html, never bother about the source folder.
Note that, in order for your Activity to access the Internet and load web pages in a WebView, you must add the INTERNET permissions to your Android Manifest file:-
<uses-permission android:name="android.permission.INTERNET" />