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

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    }