I know this has been asked many times and most have the same answer: "Use the videplayer plugin". But this is not the way some of us would like to play a video, we want to play in inline. And according to me there is not answer.
http://simonmacdonald.blogspot.ca/2012/10/partial-support-for-video-tag-in.html
Can any one give an answer that plays the video inline in the phonegap webview?
I know poeple are playing html5 video tags in the Android webview (inline), building their own webviews, so what is the problem with phonegap?
I mean can android devices seriously not play html5 video in the phonegap webview in 2013??
Even trying this: (apparently you cant play videos out off the assets folder)
<video id="1" autobuffer width="100%" tabindex="0">
<source src="file:///videos/video3.mp4" type="video/mp4" />
</video>
Does not work
<script type="text/javascript">
$(function(){
$("video")[0].play()
});
</script>
Manifest.xml:
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:hardwareAccelerated="true"
android:debuggable="true">
I recently ran into this problem and created a plugin that accomplishes what you are trying to do.
Here is the repository: https://github.com/jaeger25/Html5Video
Here's an example app that, on the loadRemoteFileFromHTTP branch, successfully loads a video file in a webview from a remote location. On the loadLocalFileUsingFileReader branch, the test.m4v file exists on the SD Card of he the device by being referenced as file:///mnt/sdcard/external_sd/test.m4v. The gotcha is when you trying to include the video file in your App. There's no way to use the file:/// protocol to reference something in your App and you cannot use relative URLs for referencing videos in a WebView. In other words, if you have your video file in your assets/www directory and you set src to "nameOfVideo.mp4", it plain won't work :(. See the loadLocalFileUsingRelativeURL branch for an example.
Here's a bug report on the Relative URL issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With