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="vieo" controls>
<source src="http://videos.mozilla.org/serv/webmademovies/popcornplug.mp4"></source>
<source src="http://videos.mozilla.org/serv/webmademovies/popcornplug.ogv"></source>
<source src="http://videos.mozilla.org/serv/webmademovies/popcornplug.webm"></source>
</video>
JavaScript
// create our instance of popcorn
var popcorn = Popcorn( "#vieo" ),
count = 0;
// make the video continuosly loop
popcorn.loop( true );
// run a specified function at 0 seconds, exec
popcorn.exec( 0, function( event ) {
// if our counter is longer then the video, then do nothing
if ( count < popcorn.duration() ) {
// in *count* seconds log something
setTimeout(function() {
console.log( "Logging at " + count + " seconds!" );
}, ++count * 1000 );
}
});
popcorn.play();