I am running the following code for html5 video.
var media;
function videotr(){
media = document.createElement('video');
media.preload = true;
media.id = 'it';
document.getElementById('crop').appendChild(media)
return media;
}
var div = document.getElementById('crop');
$(div).empty();
this.image = new videotr();
this.image.src = args.src;
However, I would like to implement multiple sources for compatibility. How can add in multiple sources through java script? I want to do this the right way, not through innerHtml.
Create a new
source
element and append it to thevideo
element:Here's a fiddle for it.