Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
  <head>
    <meta charset=utf-8 />
    <title>Loop Test</title>
    <link href="http://vjs.zencdn.net/4.1.0/video-js.css" rel="stylesheet">
    <script src="http://vjs.zencdn.net/4.1.0/video.js"></script>
  </head>
  <body>
    <video id="video" class="video-js vjs-default-skin" controls
  width="640" height="360">
      <source src="http://videos.mozilla.org/serv/webmademovies/popcornplug.ogv"  type='video/ogg'/>
    </video>
  </body>
</html>
 
var myFunc = function() {
  var player = this;
  console.log('ended = ' + player.currentTime());
  console.log(' duration: ' + player.duration());
  player.currentTime(0);
  player.play();
};
var vid = videojs("video", {}, function() {
  this.on('ended',myFunc);
});
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers