Change HTML5 Video Source
by Brian Patino
HTML
<video width="320" height="240" id="bg" autoplay loop controls>
<source src="/static/media/1.webm" type="video/webm">
<source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4">
</video>
JavaScript
window.onclick = function() {
var randint = Math.floor(Math.random() * 10) + 1;
var srcmp4 = "http://techslides.com/demos/sample-videos/small.mp4";
var video = document.getElementById('bg');
var source = document.getElementByTagName('source');
source = srcmp4;
video.load();
};