1

i have developed a website using opencart in my site i have placed a video in the home page and it works fine in chrome,mozila,IE but the video was not working in safari browser and i have used the html5 video tag, can any suggest me how play the video in safari browser this is the code i have used to play the video in mysite

                <video id="video_background" autoplay loop="loop" autobuffer="autobuffer"  poster="catalog/view/theme/default/image/gle.jpg">
                    <source src="catalog/view/theme/default/video/glandelv2_1.ogv" type="video/ogg">
                    <source src="catalog/view/theme/default/video/glandelv2_1.mp4" type="video/mp4">
                    <source src="catalog/view/theme/default/video/glandelv2_1.webm" type="video/webm">
                </video>
martin
  • 79
  • 1
  • 8
  • 3
    possible duplicate of [Video auto play is not working in Safari and Chrome desktop browser](http://stackoverflow.com/questions/17994666/video-auto-play-is-not-working-in-safari-and-chrome-desktop-browser) – Siguza Sep 29 '15 at 11:35
  • Which version of Safari are you using? – Atif Tariq Sep 29 '15 at 11:35

1 Answers1

1

This would be a fix, add this right after the video tag:

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

Not the best way but works.

Rudie Visser
  • 570
  • 6
  • 23