Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Muted Autoplay in Chrome still not working

I am having trouble getting chrome to autoplay a video. I have set the video to muted and it auto plays in both Safari and Firefox but not chrome.

            <video autoplay muted poster="path to video" id="bgvid">

        <source src="assets/uploads/hero/livePhotoNoSound.mp4" type="video/webm">

            <source src="assets/uploads/hero/livePhotoNoSound.mp4" type="video/mp4">

        </video>    

I want to video to start playing automatically. Currently the video loads, but is just still. Everything I've read says that as long as it's muted it should play, but that is not the result I'm getting.

like image 540
Ryan Swanson Avatar asked Dec 04 '17 17:12

Ryan Swanson


1 Answers

Main answer worked with me - but just in case anyone is trying to get it to work on apple phones you must use the "playsinline" attribute for it to work. for example:

<video playsinline autoplay muted loop id="myVideo">
        <source src="xen.mp4" type="video/mp4">
    </video>
like image 67
Daniel Takyi Avatar answered Oct 04 '22 21:10

Daniel Takyi