0
<video loop autoplay muted controls id="vid">
         <source type="video/mp4" src="video_file.mp4"></source>
         <source type="video/ogg" src="video_file.ogg"></source>
</video>

Hello everyone, I found out that the autoplay tag is not working when there is no muted attribute but when I added the muted into the video tag, it will play the video. However, the video has no sound, I have gone through all the related post but I am still unable to solve the issues. May I know how to solve the issues ? I realise that there is an audio tag but unfortunately the audio tag is same as what video tag do. Both of them are not working.

ckr
  • 1
  • 1
  • Does this answer your question? [HTML5 Video autoplay with sound unmuted](https://stackoverflow.com/questions/70719678/html5-video-autoplay-with-sound-unmuted) – gru Nov 28 '22 at 12:30
  • 3
    By default, chrome is blocking autoplay for videos if the muted tag is missing. This is not a bug, but by design in order to prevent unwanted videos running and screaming into the visitors ears. – Alex Berger Nov 28 '22 at 12:30
  • @gru Hello, I have gone through the article and have implemented the code into my files but unfortunately it still remain the same Did you faced this issues before ? and solved it by referring to this article – ckr Nov 28 '22 at 13:32
  • @Hoargarth I did realise that the policy was made in 2018 and I was trying my best to figure out the solution to solve the issues – ckr Nov 28 '22 at 13:58

1 Answers1

0

Add these attributes. it should work.

 <video
  controls
  playsinline
  autoplay
  muted
  loop
  src="/videos/ocean.mp4"
></video>
Johira Afzali
  • 1,196
  • 11
  • 10