how to add multiple videos in html5 with javascript

Solutions on MaxInterview for how to add multiple videos in html5 with javascript by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "how to add multiple videos in html5 with javascript"
Ezekiel
14 Apr 2019
1document.getElementById("myVideo").setAttribute("src",videoSource[0]);
2Create a function to load and play the videos.
3 
4    function videoPlay(videoNum)
5    {
6document.getElementById("myVideo").setAttribute("src",videoSource[videoNum]);
7document.getElementById("myVideo").load();
8document.getElementById("myVideo").play();
9    }