Hello guys,
I need to change or create some html5 video tags in my android webview dynamically but that isn't working at all...
I'm using Titanium SDK 3.2.3 and Android 4.2.2 working on OSX 10.9.2 and running the app on an physical android tablet.
First I thought it was some problem with my codec, I used h264 videos but also with hardware acceleration and other codecs they won't worked. But after many tests I noticed that it is a general problem on android. You can not change the src or the video with javascript, will result in an unknown MediaPlayer error (1, -2147483648)...
Sample code:
<video id="test" width="500" height="400" controls> <source src="video/small1.webm" type="video/webm"> </video>
function change() { document.getElementById("test").src='video/small2.webm' }
<a href="nojavascript...change()">change</a>
=> The video will become black and won't run... Surprisingly this will work in an iframe from an external source.
So do you have any idea how to create or change the source of video elements inside a android webview via code?
Thank you in advance!