Code: Select all
Code: Select all
const mainVideo = $('#myVideo');
const medi = "/videos/ground_540p.mp4";
const large = "/videos/ground_1080p.mp4";
switch ( true ) {
case ($(window).width() >= 1080):
mainVideo.append("");
break;
case ($(window).width() >= 720):
mainVideo.append("");
break;
}
Code: Select all
const mainVideo = document.getElementById("myVideo");
const medi = "/videos/ground_540p.mp4";
const large = "/videos/ground_1080p.mp4";
switch ( true ) {
case window.innerWidth >= 1080:
mainVideo.append("");
break;
case window.innerWidth >= 720:
mainVideo.append("");
break;
}

Ich hoffe, das ist ein guter Weg. Und mein Video wird nicht zweimal geladen.
Bearbeiten:
Das habe ich getan so:
Code: Select all
I'm sorry; your browser doesn't support HTML video.