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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -