JSFiddle - React, Tailwind, and code Playground

by Dan Daniel

HTML

<video id="video1" autoplay="autoplay">
    <source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4" />
</video>
<button onclick='playVideo();'></button>

CSS

body {margin:0;padding:0;}
video#video1 {width:100%;height:100%;}

JavaScript

var video = document.getElementById('video1');
    video.addEventListener('ended',function(){
        alert('The video has ended.')
        window.location.href = 'http://www.google.com';
    });
    video.play();