jQuery(document).ready(function($){ var currentVid = $('video')[0].currentSrc, supportedType; if (currentVid.indexOf('mp4') > 0) { supportedType = 'mp4'; } else if (currentVid.indexOf('webm') > 0) { supportedType = 'webm'; } else if (currentVid.indexOf('ogg') > 0) { supportedType = 'ogg'; } if ($(window).innerWidth() < 768) { $('video')[0].src = $('video .' + supportedType + '.sp ').attr('src'); } else { $('video')[0].src = $('video .' + supportedType + '.hd ').attr('src'); } });
CWI logo: Cyberworld Institute