No, I did not mean that, I meant exactly before
which is the line that start reproducing the video? you did not answer that
No, I did not mean that, I meant exactly before
which is the line that start reproducing the video? you did not answer that
videoElem.play();
So you mean this:
<script>
const videoElem = document.getElementById('myVideo');
const playPauseButton = document.getElementById('btnPlay');
playPauseButton.addEventListener('click', () => {
if (videoElem.paused) {
videoElem.muted = false;
videoElem.play();
playPauseButton.textContent = 'Pause';
playPauseButton.classList.add('transparent');
} else {
videoElem.pause();
playPauseButton.textContent = 'Play';
playPauseButton.classList.remove('transparent');
videoElem.muted = !videoElem.muted;
}
});
</script>
yes. Does it work? I can only guess, not having something to reproduce
no very knowledgeable one
any other ideas?
can you put up a github repo? I canât reproduce only with copy and pasting here
This is the repository:
@hasanzaib1389 @ILM its been quite quiet recentlyâŚ
Not sure if you saw the repository
please stop pinging, Iâm not online all the time, and it takes time to set up and test a website
I donât experience the popup to unmute, but the video reproduce with sound
maybe check your browser settings?
The popup does not unmute the video for you too?
You didnât add any code for the popup, and it is just on the page, with no handlers for the buttons. Update the repo if you have new code that isnât in it.
As far as I know, the video should play with audio when the playback is initiated by a user interaction (i.e. the play button). As long as it doesnât have the autoplay
attribute, which also requires the muted
attribute in most browsers, it seems. If you are trying to unmute an autoplaying video, that is a different issue.
I donât see no popup
Its not made with css on that repository so it just appears below the video
Thanks for the article. It doesnât seem to deal with unmuting an autoplaying video though
the video plays unmuted for me
which happens after you hit play? or did you add any other code?
Can you show me how it looks on your side of things?
How did you transcribe the code