How do you change the src of a HTML5 video tag using jQuery?
I got this HTML:
This is working on Flowplayer 6.0.2.
<script>
flowplayer().load({
sources: [
{ type: "video/mp4", src: variable }
]
});
</script>
where variable is a javascript/jquery variable value, The video tag should be something this
<div class="flowplayer">
<video>
<source type="video/mp4" src="" class="videomp4">
</video>
</div>
Hope it helps anyone.
I would rather make it like this
<video id="v1" width="320" height="240" controls="controls">
</video>
and then use
$("#v1").html('<source src="test1.mp4" type="video/mp4"></source>' );