Advertisement
1xptolevitico69

HTML video playlist + loop

Jun 9th, 2019
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.81 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width">
  7. <style>
  8. video {  width:978px;display:none;padding:5px;  }
  9. .video_frame {  border:20px solid maroon;display:inline-block; }
  10.  
  11. </style>
  12. </head>
  13. <body>
  14.  
  15. <center><div class='video_frame'>
  16. <video id='video' controls></video>
  17. <a href='1.mp4' ></a>
  18. <a href='2.mp4' ></a>
  19. <a href='3.mp4' ></a>
  20. </div></center>
  21.  
  22.  
  23. <script>
  24. i=0;
  25. x = document.getElementsByTagName('a');
  26. video.src=x[i];
  27. video.play();
  28. video.style.display='block';
  29.  
  30. video.onended=function(){
  31. video.style.display='none';
  32.       i++;
  33.       video.src=x[i];
  34.       video.play();
  35.       video.style.display='block';
  36. if(i > 2){
  37.       i=0;
  38.       video.src=x[i];  
  39.       video.play();
  40. }
  41. }
  42.  
  43.  
  44. </script>
  45. </body>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement