jquery - issue with getting video source from javascript -
i trying sources of videos through javascript. code below working fine. works 1 video only, if add same code multiple videos, none of videos work. using video.js
main player videos.
html:
<source id="01" src="" type='video/mp4'/>
javascript:
document.getelementbyid("01").src="link";
you absolutely need reload video after changing source. give exemple jquery
var video = document.getelementbyid("01"); $(video).attr('src', "newlink.mp4"); video.load();
but can achieve without jquery
var video = document.getelementbyid("01"); video.src= "newlink.mp4"; video.load();
Comments
Post a Comment