<!doctype html>
<html>

<head>
  <meta charset="UTF-8">
  <title>Brightcove restart on end</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  
  <video id="heroPlayerID"
  data-account="1752604059001"
  data-player="52d490a5-eef6-4e2e-a39f-d9c4b212d45f"
  data-embed="default"
  controls
  class="video-js">
  </video>
  
  <script src="//players.brightcove.net/1752604059001/52d490a5-eef6-4e2e-a39f-d9c4b212d45f_default/index.min.js"></script>
  <script src="script.js"></script>

</body>
</html>
// Code goes here
var heroVideo;
var src;
videojs('heroPlayerID').ready(function() {
  heroVideo = this;
  src=heroVideo.currentSrc();
  heroVideo.poster('http://animal-dream.com/data_images/tiger/tiger8.jpg');
  heroVideo.on('ended', resetOnEnded);
  heroVideo.on('play', onPlay);

});

function resetOnEnded(){
 // heroVideo.reset();
  //videojs.removeClass(heroVideo.contentEl(),"vjs-has-started");
  //heroVideo.poster('http://animal-dream.com/data_images/tiger/tiger8.jpg');
  heroVideo.src(src);
}
/* Styles go here */
.video-js {
      height: 344px;
      width: 610px;
}