javascript - How can I update the video dynamically in this context? -
i have working 1 video have 3 thumbnails , want update video once click on thumbnail.
so code have , guess somehow should put video names in array. how call video array?
function playvideo(){ if(!vidinitialized){ vidinitialized = true; $("#video").append( "<source src='video/video1.mp4' type='video/mp4'></video>" ); $("#video").append( "<source src='video/video1.webm' type='video/webm'></video>" ); initvideo('pause'); }else{ video.currenttime=0; } } function addeventlisteners() { document.getelementbyid("video1").addeventlistener("click", playvideo); document.getelementbyid("video2").addeventlistener("click", playvideo); document.getelementbyid("video3").addeventlistener("click", playvideo); }
Comments
Post a Comment