SOLVED: Background video does not autoplay in Chrome

Bricks Version: 1.3.4
Browser: Chrome 94.0.4606.61
OS: macOS
URL: https://ho.maarevenonline.nl/

I used an uploaded mp4 file as a background video but it does not autoplay while loading or reloading the website. When I click on the home link in the menu it starts playing. Does anyone know the cause or a fix for it?

I open your website and the video is played automatically.

Hi, thanks for your quick reaction!
It does not work in Google Chrome (at least not here on my Mac and PC).

I’ve tried it in MS Edge… Does not work… No clue why.

I fixed it by using and styling the video widget in stead of setting a background video. This is the working homepage which also auto plays in Chrome: https://ho.maarevenonline.nl/

And this is the old homepage with the background video: https://ho.maarevenonline.nl/home-old/

Just out of curiosity; if anyone knows why the autoplay does not work in Chrome when setting the video as a background, please let me know!

Hello @barthusz

I’ve tried to reproduce the issue on my local installation and for me it works (Chrome).

I suspect the issue is because you didn’t use the full path URL when setting the video link in the Background video control:

Screenshot 2021-10-21 at 15.37.54

Could you please try using the full path?

Screenshot 2021-10-21 at 15.36.23

Thank you.

Hi @luistinygod

Sorry for my late reply, I did not notice you replied!
Thanks a lot for testing and I just changed the url to an absolute one ( https://ho.maarevenonline.nl/wp-content/uploads/2021/10/schapen2.mp4 ). Unfortunately it still does not work, see: Home old – Holland Online
Have a great evening!

Bart

I am experiencing the same issue. Autoplay works in Firefox, Safari, Google Chrome app on iOS, not in Google Chrome desktop.

Same here, using local mp4 background video doesn’t autoplay in Edge nor Chrome, PC and Android. On iOS it’s working fine in Chrome and Safari.

Using YouTube link video doesn’t autoplay on Android or iOS, but it does in PC (Edge and Chrome)

From what I can tell, it looks like Chrome thinks the video.muted attribute is set to false and so autoplay is not allowed. I currently adding my own workaround by collecting the videos from the DOM tree and setting video.muted to true and invoking the play function. It’s challenging because the only videos on the DOM tree are the ones in the vh.

It’s weird because the video html element renders “muted” correctly. Maybe has something to do with how the JS builds the page?

I have the same problem. Any new findings?

Hi guys,
I’ve just tested this with the upcoming Bricks 1.4 and in case of my video, it autoplays without sound and any issues (unlike the same video with Bricks 1.3.7) :rocket:

Best regards,
timmse

1 Like

@timmse That’s good news!

Does it work for you as well?

@timmse I just ran across this “bug”? as well. It appears to only autoplay with mute enabled. However, if you click on the video, even turning off the controls, it still allows you to start/stop the video. I don’t know if this is by design? Also, please clarify what ‘play inline’ does?

Same happened to me in Elementor… It’s a Chrome thing… :slight_smile:

Hey Lyle, autoplay generally only works when the video is muted - that’s not a bug and there’s nothing we can do about it (which is a good thing).

Playsinline:

Best regards,
timmse

1 Like

Since April 2018, Google made some changes to the Autoplay Policy. You not only need to add the autoplay=1 as a query param, but also add allow=‘autoplay’ as an iframe’s attribute

So while embed YouTube video, you will have to do something like this:

<iframe src="https://www.youtube.com/embed/VIDEO_ID?autoplay=1" allow='autoplay'></iframe>

1 Like

If you use the Video element make sure you have the mute toggle “on”

SCR-20231214-pqav

1 Like

Hey everybody. The reason why video is not running in edge is most likely because you are running a dedicated GPU witch means DirectX. Edge video Runs only in OpenGL. Took me a lot of frustrating hours to finally figure it out. When I switched my MSI laptop from dedicated to Hybrid and restarted i opened up Edge and the background starting playing automatically. Thats because it was able to see the Intel GPU to use OpenGL for the video.

For MSI laptops the setting is in MSI Center >features>General settings>GPU Switch For all other laptops google and Bing are your best friends