We have a site with an autoplay video on the front page. The video is quite big (over 40mb) and is set to not display on mobile devices. It’s a bit hard to tell, but it seems that when the site is loaded on a mobile device the video file is actually downloaded, but then not displayed. In this country cellular data is not cheap, so forcing your visitors to download a 40mb file is rather rude. Is there a way to tell devices which can’t actually show the content not to download it?
I have my own views on autoplay videos – particularly on the homepage – but ‘that’s what the client wants’.
private url added
Hi,
Thank you for using Enfold.
Add this script in the functions.php file to remove the video container on mobile view.
add_action('wp_head', 'ava_remove_video_on_mobile', 10);
function ava_remove_video_on_mobile() {
if(wp_is_mobile()) {
?>
<script>
(function($) {
$('.avia-slideshow .mejs-container').remove();
})(jQuery);
</script>
<?php
}
}
Please test it on an actual mobile device.
Best regards,
Ismael