With the above; within the HTML
In short: what you need is to add video.addEventListener('ended',function() {}) and trigger video.load() in your custom JavaScript.
Here is a related post that redirects after video is played, you may modify it accordingly - Redirect html5 video after play.
References to look for detailed information: