Is there a way to prevent video from loading entirely?

Hello, does using media breakpoints to hide video from appearing on mobile devices nonetheless allow video to load/play in the background on those devices thereby hindering loading speed? I’ve noticed that when flipping a mobile device horizontally my video plays at any point in the middle of its loop, suggesting that it is playing in the background regardless of being hidden below the mobile breakpoint. If this is the case, is there code to prevent video from loading (not just appearing) on mobile devices?

Hello There,

Thanks for posting in! Hiding the video in smaller screens will not load the videos at all. And also, videos will not be automatically loaded in smaller screens. In most case, the videos were automatically gets disabled by default in smaller screens since they are bandwidth hogger. You do not need any special code to prevent it from loading. The device or the mobile browser will not load the video by default.

Hope this helps.

Hi @RueNel thank you for that reply. I have noticed, however, that the video must be loading because when flipping a mobile device horizontally, thereby increasing the screen width above the mobile breakpoint threshold, the video immediately appears and will be playing somewhere in the middle. So it must be that the video is playing in the background regardless of whether or not it is displaying. Is there a way to fix this?

Hi there,

If it’s configured for autoplay, then yes, it will play even if it’s hidden. But it must not play on mobile due to device restriction. Would you mind providing a sample URL where we can test it? And which mobile device you’re testing it with?

Thanks!

It’s fondudes.com and the device is iPhone 6

Hi there,

Yes, looks like it’s playing in the background but muted. How about adding your video as a background instead of a layer?

And yes, it looks like you only hidden the video layer through slider options. It still there.

Thanks!

Hi @Rad I have the video added as a layer rather than as a background because the beginning and end of the video loop morph into position with the surrounding imagery on the page. How would adding a video as a background for an entire slide rather than as a layer give the desired control insofar as preventing loading of the video on mobile devices?

Hey There,

You might need to check this documentation on how you can use a video as a background.
https://www.themepunch.com/revslider-doc/main-background/?tab=html5video

Hope this helps.

@RueNel and @Rad It doesn’t appear that having the video as the background of the slide itself has any advantage over having it as a layer. In the former the only option is to hide the entire slide itself on mobile, which could also be achieved in Cornerstone. Would creating two distinct slides; one for desktop which features the video, and one for mobile which has no video, and then from Cornerstone allowing the former to display only on desktop/laptop and the latter display only on mobile/tablet solve the problem?

Hi Jeremy,

I actually wanted to suggest the same thing that you already mentioned in the latest reply. I think that will be the way to go regarding this.

The videos are really tricky when it comes to mobile and desktop modes showing.

For more information on how to hide during the breakpoint please read this article.

Thank you.

Ok, will do. Thank you @christopher.amirian christopher !

You’re welcome :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.