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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -