I am developing an android application using Cordova. I used HTML <video>
Tag for a background video. The Video works like a charm for Lollipop OS. But it doesn't work for Kitkat 4.4.4. I have tried all formats of video(mp4, webm, ogg
). It gives me a black screen background. The poster which I am setting just in case video doesn't work is not getting displayed either.
<video autoplay loop poster="images/landing.jpg" id="bgvid">
<source src="videos/small.ogg" type="video/ogg">
<source src="videos/small.webm" type="video/webm">
<source src="videos/small.mp4" type="video/mp4">
</video>
Is there any alternative to this? How to make the video work as background for majority of Android OS.
You can use the plugin Html5Video
cordova plugin add https://github.com/jaeger25/Html5Video.git
HTML:
JAVASCRIPT (When cordova is initialized):
ANDROID PROJECT: