Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>视频播放器</title>
- </head>
- <body>
- <video id="video" controls autoplay>
- <!-- 视频源数组 -->
- <source type="video/mp4">
- </video>
- <script>
- // 视频源数组
- const videoSources = [
- "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",
- "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",
- "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"
- ];
- let currentVideoIndex = 0;
- const video = document.getElementById("video");
- function playNextVideo() {
- currentVideoIndex = (currentVideoIndex + 1) % videoSources.length;
- video.src = videoSources[currentVideoIndex];
- video.play();
- }
- window.onload = function () {
- video.addEventListener("ended", playNextVideo);
- video.src = videoSources[currentVideoIndex];
- video.play();
- };
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement