JSFiddle - React, Tailwind, and code Playground

HTML

<input id="file" type="file" multiple>

<button onclick="play()">play</button>

<video id="video" src="" autoplay controls></video>

<script>
let index = 0
video = document.getElementsByTagName('video')[0]
play = () => {
  const files = document.getElementById('file').files
  const file = files[index++ % files.length]
  const url = window.URL.createObjectURL(file)
  video.src = url
  video.load()
}
video.addEventListener('ended', play, false)
</script>