i'm working on spa where i have to show banner video on top of the website. when loading video at initial phase is there any way to unmute the audio of video.
I have tried to unmute video and override but it's not working on chrome browser. i have read article about chrome autoplay video blocking but still is there anyway to unmute video.
tried below code
<video autoplay preload="auto" muted onloadedmetadata="this.muted = true" oncanplay="this.play()" id="video-player">
<source src="https://###########" type="video/mp4" crossorigin="anonymous">
</video>
let audioPlayer = <HTMLVideoElement> document.getElementById('video-player');
audioPlayer.addEventListener('play', () => {
// audioPlayer.muted = true;
audioPlayer.play();
audioPlayer.muted = false;
});
audioPlayer.addEventListener('ended', () => {
this.showPlayBtn = true;
})
i need to auto play video with audio in all browser.
Any help will be appreciated. Thanks in advance!