JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://popcornjs.org/code/dist/popcorn-complete.min.js"></script>
<video height="180" width="300" id="video" controls preload="none">
<source src="http://videos.mozilla.org/serv/webmademovies/popcornplug.mp4"></source>
</video>
JavaScript
var v = new AudioContext();
// Listen for canplay event
v.addEventListener( "ended", function( e ) {
console.log( "ended fired!" );
}, false );
// Load the first video source.
// Depending on your network, canplay should fire soon after the call to `load`
v.load();
v.play();