//this will display vid depending on viewport size
$(document).ready(function() {
/* ==========================================================================
BKG Video
========================================================================== */
setTimeout(function(){
$('.video-container iframe').addClass('loaded');
}, 3000);
// remove mobile video on desktop
if ( $(window).width() > 768 ) {
$('#bgvid').remove();
}
// remove desktop video on mobile
if ( $(window).width() <= 768 ) {
$('.video-container').remove();
}
}); // doc ready END
<!-- This is hardcoded -->
<body>
<asp:ContentPlaceHolder ID="videoBackground" runat="server" visible="true"></asp:ContentPlaceHolder>
</body>
<!-- This is in Matrix -->
<!-- Vimeo : for desktop -->
<div class="video-container">
<iframe id="vimeo" allowfullscreen="" frameborder="0" height="100%" mozallowfullscreen="" src="{{Module.FieldValues.DesktopVideo}}?background=1" webkitallowfullscreen="" width="100%"></iframe>
</div>
<!-- Local : for mobile -->
<video poster="SiteFiles/2204/css/images/cover.jpg" id="bgvid" playsinline autoplay muted loop>
<source src="{{Module.FieldValues.MobileVideo}}" type="video/mp4">
</video>
<!--Description: Select background videos for both desktop and mobile browsers. Desktop video must be a Vimeo link and mobile video must be a MP4 file hosted on SiteWrench.
single-line
label: Desktop Video (Vimeo link) Example: //player.vimeo.com/video/223309279
variable name: DesktopVideo
file
label: Mobile Video (MP4 video file in SiteWrench)
variable name: MobileVideo