0

I want to hide a video on mobile devices. I did this by using "@media screen and (max-width: ###px)" and "display:none", this works fine but does that prevent the video from being loaded?

Basically I want the video to be not loaded with mobile data roaming, so that users on mobile devices won't use their roaming data for that.

Is there a more convenient way of doing this?

Heinz Heiner
  • 11
  • 1
  • 1
  • 2
    Videos don't autoplay unless you force them to, and they're only loaded when you start playing them in most modern browsers. – BenM May 22 '18 at 21:17
  • So how do I prevent a video from being loaded on mobile devices, if it is on autoplay? – Heinz Heiner May 22 '18 at 21:42

2 Answers2

0

If you are asking about the css display: none then the answer is the video will still be loaded over the mobile network but it would not be visible to the end user. That being said a user could theoretically change the CSS for that element so it would display and then they could watch the video.

HopAlongPolly
  • 1,347
  • 1
  • 20
  • 48
0

Video will be loaded but it is not visible to user. To pervent loading video, instead of changing css, you can remove the video from HTML using JS

SwordW
  • 592
  • 2
  • 6
  • 20