0

I have added a video to my site. Added code for autoplay in the video. It works fine on Firefox, but not auto playing in Chrome.

Here is the code I have added to show the video:

<video id="vid" autoplay="autoplay" loop="loop" width="100%" height="100%">
     <source src="https://example.com/video.mp4" type="video/mp4" />
</video>

Also, when I face the issue, I searched for this and found a script. Here is what I have tried:

<script> 
    document.getElementById('vid').play(); 
</script>

But still, the video just below menu is not auto-playing on Chrome.

I have checked the Chrome autoplay guidelines and my video is not violating that. I have a muted video but still not auto playing.

Any workaround for that?

Thank you in advance.

  • probably a duplicate of https://stackoverflow.com/questions/16773986/html5-video-issue-with-chrome or https://stackoverflow.com/questions/16937480/mp4-not-playing-on-chrome-version-27-0 up vote if u find a solution – Akshay Mulgavkar Mar 01 '19 at 10:29
  • Nope, those are not working for me. Adding "playsinline autoplay muted loop" to the video tag worked fine for me. – Jitendra Mishra Mar 01 '19 at 11:46

3 Answers3

1

If think you need to add playsinline autoplay muted loop into you'r video tag.

Enzo B.
  • 2,341
  • 1
  • 11
  • 33
0
autostart="false"

<video id="vid" autoplay="false" loop="loop" width="100%" height="100%">
 <source src="https://example.com/video.mp4" type="video/mp4" />
</video>

or

https://www.groovypost.com/howto/disable-autoplay-videos-on-sites-in-google-chrome/

try this

0

If you want auto play option on then make this and your chrome browser should be upper than 4.0 then this code will work.