This plugin allows playback of local video files using embedded html 5 video tags. This repository contains both the plugin files and a sample Android application that uses the plugin. Tested on Android API 15 - 17
- Create your cordova project: cordova create ProjectName
- Add platforms: cordova platform add android
- Add the plugin: cordova plugin add https://github.com/jaeger25/Html5Video.git
The next changes should be done inside your PlatformName/www folder
- Create any video tags within your html pages as normal, making sure to give each video tag an id. The video tags should be empty, ie no
- Add any poster image files to your www folder
The next changes should be done inside your ProjectName/platforms/android folder
-
Make sure the tag in AndroidManifest.xml has android:hardwareAccelerated="true"
-
Create a folder called raw inside the res folder and put any video files in it. (not poster image files)
-
run cordova build
-
launch app
After device ready, call window.plugins.html5Video.initialize({"video1":"video1file.mp4", "video2":"video2file.mp4"}).
Anytime you wish to play a video, call window.plugins.html5Video.play("video1", callback).