Autoplay Background Video - Not working


I have this magical script in the custom code section. But it is not autoplaying on mobile devices. I switched out my video yesterday and I’ve wasted countless hours on this… Very frustrating to say the least:

Project link:

Script I have:

var mobilevideo = document.getElementsByTagName("video")[0];
mobilevideo.setAttribute("playsinline", "");
mobilevideo.setAttribute("muted", "");
<!-- END: Mobile Autoplay Video -->

Hi @Jason_Drury,

Might find some good information in this thread :slight_smile:

Thanks! I saw that post. Tried it… It doesn’t work on Android. The script above is from a another recent support post that was working on all OS mobile and desktop etc.

What I don’t understand is that all of a sudden after I switched out the video banner it doesn’t autoplay on mobile anymore. It was working perfectly fine before! :rage:

I have the exact same code… so I am not sure why it is not working :frowning:

Could it be some client side setting to limit the data usage? I remember setting something like this on my android phone.

I am not sure. But, the original video before I switched it out was 3MB and the new video is about half that 1.5MB. I don’t believe that is the problem… Its strange. I can’t figure it out…

I had some what of the same problem with the first video. But, I was able to get it work. Now that I switched it out I am back trying to figure out what I did to make this work.

Has there been any updates to current browsers I am not aware of?

Thanks for LQQKing into this :smiley: