-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsequentialPlayer.js
More file actions
29 lines (25 loc) · 1.4 KB
/
sequentialPlayer.js
File metadata and controls
29 lines (25 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
document.addEventListener('DOMContentLoaded', function() {
const videoSources = [
"https://media.signbsl.com/videos/bsl/signstation/ME.mp4",
"https://media.signbsl.com/videos/bsl/gpnhs/mp4/professor.mp4",
"https://media.signbsl.com/videos/bsl/signstation/your.mp4",
"https://media.signbsl.com/videos/bsl/signstation/computer.mp4",
"https://media.signbsl.com/videos/bsl/signstation/science.mp4"
// Add more video URLs here
];
let currentVideoIndex = 0;
const videoElement = document.getElementById('bslVideo');
videoElement.muted = true; // Mute the video so browsers don't block autoplay
videoElement.controls = false; // To hide the browser controls and prevent users from pausing the video
videoElement.addEventListener('ended', playNextVideo);// Play the next video when the current one ends
function playNextVideo() {// Play the next video
if (currentVideoIndex < videoSources.length) {// Check if there are more videos to play
videoElement.src = videoSources[currentVideoIndex];// Set the video source
videoElement.play().catch(e => console.error(e));// Play the video
currentVideoIndex++;// Increment the index
} else {
console.log('All videos played.');// Log a message when all videos have been played
}
}
playNextVideo(); // Start the first video on load
});