Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script src="jquery-3.1.0.min.js"></script>
- <script>
- var vid;
- var vid_seek=0;
- var vid_seek_prev=0;
- var set_play=false;
- function seek_check()
- {
- vid_seek = vid.currentTime;
- if(vid_seek == vid_seek_prev) {
- if(!set_play) {
- vid.play();
- set_play=true;
- } else {
- location.reload();
- }
- }
- else {
- set_play=false;
- }
- vid_seek_prev=vid_seek;
- }
- $(document).ready(function(){
- vid = document.getElementById("my_video");
- setInterval(function(){ seek_check(); }, 1000);
- });
- </script>
- </head>
- <body>
- <div id="video_player_box">
- <video id="my_video" width="400" height="400" muted>
- <source src="5.mp4">
- </video>
- <div id="video_controls_bar">
- <span class="seek"></span>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement