Streaming live at 10am (PST)

Autoplay Background Video - Not working


#1

HELP!

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: https://preview.webflow.com/preview/dcanco?preview=fbe8458f49bd6f8cecdb68d8e7c7f2b2

Script I have:

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

#2

Hi @Jason_Drury,

Might find some good information in this thread :slight_smile:


#3

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:


#4

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


#5

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: