Skip to content Skip to sidebar Skip to footer

Jump To Timestamp In Html5 Embedded Video With Video-js

Greetings overflow, I'm trying to create buttons on a webpage that jump to tagged timestamps for an embedded video with video-js. Far as I can gather, I need to change the current

Solution 1:

Remove the "VideoJS.setupAllWhenReady();" and it should work. This is what I have:

<!DOCTYPE html>
<html>
 <head>
  <title>Sample styled page</title>
  <script src="video-js/video.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" href="video-js/video-js.css" type="text/css" media="screen" title="Video JS" charset="utf-8">
 </head>
 <body>
  <h1>Sample styled page</h1>
  <p>This page is just a demo.</p>
  <video id="current_video" class="video-js" width="400" height="300" controls="controls" preload="auto">
    <source src="pr6.webm" type='video/webm; codecs="vp8, vorbis"' />
  </video>
  <script>
    //VideoJS.setupAllWhenReady();
    VideoJS.DOMReady(function() {
        var myPlayer = VideoJS.setup("current_video");
        myPlayer.play();
        myPlayer.currentTime(200);
    });

  </script>
 </body>
</html>

Solution 2:

 $(function(){
 var myPlayer = _V_("my_video_1");
     _V_("my_video_1").ready(function(){ 

     myPlayer.src([
      { type: "video/mp4", src: "http://video-js.zencoder.com/oceans-clip.mp4" },
      { type: "video/webm", src: "http://video-js.zencoder.com/oceans-clip.webm" }
    ]);  

    });
  });

  $(window).load(function(){
  var myPlayer = _V_("my_video_1");

 myPlayer.currentTime(30); 
 myPlayer.play()
  });

Post a Comment for "Jump To Timestamp In Html5 Embedded Video With Video-js"