Section background video keeping phone from sleeping

This is a bit of an odd one, but when a video background is playing my phone screen stays on, even after the timeout for the screen to turn off has passed.
It’s never done that before the latest 3.0.0 release and does it whether you’re at the top of the page where the hero is or further down the page.
I’ve noticed it on 3 sites now.

Any ideas? I appreciate it may be a hardware thing too, but as I’ve said, not happened before!

Hi Chris,

My understanding of mobile browsers is that they will stay active anytime a video is playing. It shouldn’t timeout because it assumes you’re watching something. Regretfully we don’t have a way to distinguish background videos from normal ones. I’m honestly not sure why the behavior would have changed from one release to the next. I don’t recall us changing anything there, and our videos are really just a wrapper for the native WordPress MEJS players.

Hi @alexander!

It may have just been that I never noticed it before, to be honest. And just where I’m working on some sites at the moment with video headers that I noticed it.

It does make sense that the behaviour would be to keep it open, just a shame we can’t label it as a ‘decorative’ video rather than an actual video to override that behaviour.

Hope all’s well!

Right, it would be nice to indicate what kind of video requires that behavior. All is well! Hope the same for you :slight_smile:

All good here thanks!

I’ve just noticed something somewhat related to this.

I have a column that I have hidden for mobile and tablet breakpoints. In that column is an autoplaying video.
On mobile, the screen stays awake forever.
Does the column still get loaded and therefore the video is still playing even though it is hidden on this breakpoint?

This is the page: https://honeymoonstudios.co.uk/honeymoon-new/

Hi Chris,

I see what you mean - yes, it is playing all the time even when not being displayed. I’ll make a note of seeing if this is something we can work on polishing up.

Meanwhile, if you turn off autoplay on that video, you can setup a separate auto play script like this:

jQuery(function($) { if (window.innerWidth < 980) { document.querySelector('.video-custom-class video').play() } })

That will play the video when the page loads, but only on screens smaller than 980px wide. You can add that to the page’s custom scripts. You’ll just need to add a custom class (replace video-custom-class) to the video element.