JSFiddle - React, Tailwind, and code Playground

by TastyBytes

HTML

<link rel="stylesheet" href="http://vjs.zencdn.net/4.1/video-js.css">
<script src="http://vjs.zencdn.net/4.1/video.js"></script>
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="264"
      poster="http://video-js.zencoder.com/oceans-clip.png"
      data-setup="{}">
    <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />
  </video>

JavaScript

videojs("example_video_1").ready(function(){
    var myPlayer = this;
  
    var firstVideoEnded = function() {

        myPlayer.src('http://stream.flowplayer.org/bauhaus/624x260.mp4') 
        //myPlayer.play();
        myPlayer.el().setAttribute('loop', 'true');
    }
    
    
    
    
    // myPlayer.one sets up an event that will only be caught once
    myPlayer.one('ended', firstVideoEnded);
  

});