Rene Juuse
Rene Juuse

Reputation: 585

What is the simplest or best way for preventing the background video from loading on mobile browsers?

I have a webpage which loads a video as a background. I want to prevent the video from loading on (at least some) mobile browsers. I have disabled displaying the video using the @media tag, but I think that this doesn't prevent the browser from loading the video.

@media screen and (max-device-width: 800px) {
    #bgvid {
        display: none;
    }
}

I'd like to know how to prevent the video from loading on mobile browsers. It would be especially great if it could be done without using JavaScript.

Upvotes: 0

Views: 90

Answers (1)

Rene Juuse
Rene Juuse

Reputation: 585

Turned out that media tags were enough to prevent the loading of videos on mobile browsers (for devices that don't exceed the specified width).

Upvotes: 1

Related Questions