I'm writing a custom module that plays a video. I'd like to change the style of the controller to get rid of the black gradient under the player controls and change the controls to black instead of white.
I tried changing these styles in CSS but the changes are not showing up.
/* Updated video control styles */ .video-controls { position: absolute; bottom: 0; left: 0; width: 100%; background: none!important; /* Set background to transparent */ color: black; /* Changed text color to white */ padding: 5px; /* Adjust padding as needed */ font-family: Arial, sans-serif; /* Adjust font family as needed */ display: none; /* Initially hide controls */ }
/* Show controls when hovering over video */ video:hover .video-controls { display: flex; }
#volumeControl { margin-right: 10px; /* Added margin to separate from the mute button */ }
// Function to change video source based on screen width function changeVideoSource() { const newsrc='https://www.collegenet.com/hubfs/videos/series25-video-obs-1.mp4'; videoPlayer.src=newSrc; videoPlayer.load(); videoPlayer.muted = true; // Mute the video initially videoPlayer.volume = 0.2; // Set initial volume to a low level videoPlayer.play(); // Attempt to autoplay }
// Check if it's the second video and toggle controls accordingly if (isSecondVideo) { videoPlayer.setAttribute('controls', ''); } else { videoPlayer.removeAttribute('controls'); } }
// Call function to set the initial video source changeVideoSource();
// Event listener to change video source when the video is clicked videoPlayer.addEventListener('click', () => { isSecondVideo = !isSecondVideo; handleVideoClick(); }); };