Advertisement
Guest User

Untitled

a guest
Jul 30th, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.77 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.  
  5. <script src="jquery-3.1.0.min.js"></script>
  6.  
  7. <script>
  8. var vid;
  9. var vid_seek=0;
  10. var vid_seek_prev=0;
  11. var set_play=false;
  12.  
  13. function seek_check()
  14. {
  15. vid_seek = vid.currentTime;
  16.  
  17. if(vid_seek == vid_seek_prev) {
  18.  
  19.     if(!set_play) {
  20.         vid.play();
  21.         set_play=true;
  22.     } else {
  23.         location.reload();
  24.     }
  25. }
  26. else {
  27. set_play=false;
  28. }
  29.  
  30. vid_seek_prev=vid_seek;
  31.  
  32. }
  33.  
  34. $(document).ready(function(){
  35. vid = document.getElementById("my_video");
  36.  
  37. setInterval(function(){ seek_check(); }, 1000);
  38. });
  39. </script>
  40. </head>
  41. <body>
  42.     <div id="video_player_box">
  43.         <video id="my_video" width="400" height="400" muted>
  44.             <source src="5.mp4">
  45.         </video>
  46.         <div id="video_controls_bar">
  47.             <span class="seek"></span>
  48.         </div>
  49.     </div>
  50. </body>
  51. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement