-
Notifications
You must be signed in to change notification settings - Fork 0
/
raheem-youth.js
13 lines (12 loc) · 911 Bytes
/
raheem-youth.js
1
2
3
4
5
6
7
8
9
10
11
12
13
function serveVideo() {
const videoBit = document.getElementById('video__container');
if (window.innerWidth <= 500) {
videoBit.innerHTML =
'<video controls playsinline poster="assets/raheem-kids-video-ph-sq.jpeg" preload="none" width="100%" height="auto" class="image--rounded-border"><source src="assets/raheem-bts-portrait.mp4" type="video/mp4"><track kind="captions" src="assets/raheem-bts-video.vtt" srclang="en"></video>';
} else {
videoBit.innerHTML =
'<video controls playsinline poster="assets/raheem-kids-video-ph-fw.jpeg" preload="none" width="100%" height="auto" class="image--rounded-border"><source src="assets/raheem-bts-landscape.mp4" type="video/mp4"><track kind="captions" src="assets/raheem-bts-video.vtt" srclang="en">Your browser does not support the video tag.</video>';
}
}
window.onload = serveVideo;
window.onresize = serveVideo;