Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2023
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <head>
  5. <title>视频播放器</title>
  6. </head>
  7.  
  8. <body>
  9. <video id="video" controls autoplay>
  10. <!-- 视频源数组 -->
  11. <source type="video/mp4">
  12. </video>
  13.  
  14. <script>
  15. // 视频源数组
  16. const videoSources = [
  17. "https://cdn.gouuuu.com/2023/08/tvzongheba-%E6%97%A0%E7%94%A8%E7%9A%84%E8%B0%8E%E8%A8%80-%EC%86%8C%EC%9A%A9%EC%97%86%EC%96%B4-%EA%B1%B0%EC%A7%93%EB%A7%90-My-Lovely-Liar-E01-000.mp4",
  18. "https://cdn.gouuuu.com/2023/08/tvzongheba-%E6%97%A0%E7%94%A8%E7%9A%84%E8%B0%8E%E8%A8%80-%EC%86%8C%EC%9A%A9%EC%97%86%EC%96%B4-%EA%B1%B0%EC%A7%93%EB%A7%90-My-Lovely-Liar-E01-001.mp4",
  19. "https://cdn.gouuuu.com/2023/08/tvzongheba-%E6%97%A0%E7%94%A8%E7%9A%84%E8%B0%8E%E8%A8%80-%EC%86%8C%EC%9A%A9%EC%97%86%EC%96%B4-%EA%B1%B0%EC%A7%93%EB%A7%90-My-Lovely-Liar-E01-002.mp4"
  20. ];
  21.  
  22. let currentVideoIndex = 0;
  23.  
  24. const video = document.getElementById("video");
  25.  
  26. function playNextVideo() {
  27. currentVideoIndex = (currentVideoIndex + 1) % videoSources.length;
  28. video.src = videoSources[currentVideoIndex];
  29. video.play();
  30. }
  31.  
  32. window.onload = function () {
  33. video.addEventListener("ended", playNextVideo);
  34. video.src = videoSources[currentVideoIndex];
  35. video.play();
  36. };
  37. </script>
  38. </body>
  39.  
  40. </html>
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement