let video = document.getElementById('videoElement');
let playButton = document.querySelector('.play');
let muteButton = document.querySelector('.audio');
let fullScreenButton = document.querySelector('.fullscreen');
// Event listener for the play/pause button
playButton.addEventListener("click", function() {
if (video.paused == true) {
// Play the video
video.play();
playButton.classList.remove("paused");
} else {
// Pause the video
video.pause();
playButton.classList.add("paused");
}
});
// Event listener for the mute button
muteButton.addEventListener("click", function() {
if (video.muted == false) {
// Mute the video
video.muted = true;
muteButton.classList.remove("unmuted");
} else {
// Unmute the video
video.muted = false;
muteButton.classList.add("unmuted");
}
});
// Event listener for the full-screen button
fullScreenButton.addEventListener("click", function() {
if (video.requestFullscreen) {
video.requestFullscreen();
} else if (video.mozRequestFullScreen) {
video.mozRequestFullScreen(); // Firefox
} else if (video.webkitRequestFullscreen) {
video.webkitRequestFullscreen(); // Chrome and Safari
}
});