Just use HTML5 video tag
<video width="50" height="60" id="video-target" controls>
<source src="www.yourpath.com" type="video/mp4">
There is a <video> tag in there already, and it works for Android 5.0.1 as I said, but not for the earlier versions. Here's the tag:
<video id="_idVideo000" poster="image/5.png" controls="controls">
<source src="video/Sample_Clip_640x360.mp4" type="video/mp4" />
It sees the poster image, but when you tap the play button, it just goes black.
Why would this work in 5.0.1 but not 4.2.4 and 4.4.4?
Perhaps you didn't read the article I pointed to.
Since you still have the video in your app's assets, Android's default webview won't access it. As the article claims, you should first move the file to the device (or its SD card).
Thanks so much for the help. Sorry for the delay, I was actually reading it now. As I said, I'm not a developer so I get stuck with anything more than rudimentary coding, so please bear with me.
Since I'm using PhoneGap Build rather than PhoneGap, I'm not sure how to apply this path change. The plugin referenced won't work for me. I see what you're talking aobut, but I'm not seeing the path recommended in the article in Problem #1-- platforms/android/res/raw -- nor how to point the app to it if I could. Can you help with this? Perhaps another article somewhere?
Again, thanks a ton for your help. Also, as a further point of information, the device(s) I'm targeting are an S5 with 4.4.4 and a Note II with 4.2.4 and they have to work with no connection to the internet.
1 person found this helpful
Well, you'd need to do some coding/development for this.
The idea is:
1 - detect whether the app is started for the first time or not. If it is:
2 - while showing the first screen (index.html) copy the video file from the assets to a device location (e.g. sd card)
3 - point the html video element to this new location
In order to perform step-1, simply read the file information from that location. If not found, step-2 must be executed
In order to perform step-2, you would read the file from your assets and create a new file with the same contents on sd card.
For both, you use the File plugin from npm (which you specify in your config), then aply the documentation for that plugin.
Yes, I'm afraid it will be a bit of a learning curve which you must work through.
Alternatively, you can add the Crosswalk webview in your app. This webview should play the html video element correctly, according to