Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.96 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <head>
  3. <title>Test Video.js</title>
  4. <link href="video-js.min.css" rel="stylesheet">
  5. <script src="video.min.js"></script>    
  6.  
  7. </head>
  8. <body>
  9. <div id="testdiv"></div>
  10. <video id="myvideo" class="video-js vjs-default-skin" width="640" height="480%" poster="RTSjrfnBIog.jpg" data-setup='{}'>
  11.         <source src="testvideo.mp4" type='video/mp4'>
  12. </video>
  13. <script>
  14. var options = {controls: 0};
  15. var player = videojs('myvideo', options, function onPlayerReady() {
  16.   videojs.log('Your player is ready!');    
  17.  
  18. var date = new Date();
  19. var today = new Date();
  20. today.setHours(2, 53, 40, 0);
  21. var w_hour = date.getHours();
  22. var timee = today.getTime();
  23. var time_offset = (date - today)/1000
  24. videojs.log( time_offset + " sec" );
  25.  
  26.  
  27.   if (time_offset > 0) {
  28.     player.currentTime(time_offset);
  29.   player.play();
  30.  
  31.   }
  32.  
  33.   this.on('ended', function() {
  34.     videojs.log('Awww...over so soon?!');
  35.   });
  36.  
  37. });
  38.                      
  39. </script>
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement