JSFiddle - React, Tailwind, and code Playground
HTML
<video id="urlVideo" controls autoplay >
<source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4">
</video>
JavaScript
//add video playlist functionality to auto play next video based on id
var videoSrc = [
"https://media.w3.org/2010/05/sintel/trailer.mp4",
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4"
]
var vid = document.getElementById("urlVideo");
var index = 0;
vid.addEventListener("ended", function() {
var currentSrc = videoSrc[index];
index+=1;
if (index >= videoSrc.length)
index = 0; // Make Loop and jump to the first video
vid.src=currentSrc;
vid.play();
console.log(currentSrc)
}, true);