Skip to content

Instantly share code, notes, and snippets.

@lrdiv
Last active December 11, 2015 14:19
Show Gist options
  • Save lrdiv/4613550 to your computer and use it in GitHub Desktop.
Save lrdiv/4613550 to your computer and use it in GitHub Desktop.
For IE9, 8, 7, 6 check user's version of Flash Player. If it's less than 11.5, use static image for background and show div prompting them to upgrade.
var bgImageInit = function(mobile) {
var bg_image = "#{image_path('application/mobile-splash-bg.jpg')}";
$('#main-container').css('background', 'url(' + bg_image + ') right top no-repeat');
if (mobile == true) {
$('#main-container').css('background-size', '70%');
}
}
var mobileInit = function() {
var BV = new $.BigVideo({forceAutoplay:is_touch});
BV.init();
BV.show("#{image_path('application/temp-background.jpg')}");
}
var bigVideoInit = function() {
var BV = new $.BigVideo({useFlashForFirefox:false});
BV.init();
BV.show("#{asset_path('raved_landing_FINAL_white.mp4')}", { altSource: "#{asset_path('raved_landing_FINAL_white.oggtheora.ogv')}" });
}
var is_touch = Modernizr.touch;
if (is_touch) {
if ( $(window).width() < 769) {
bgImageInit(true);
} else {
mobileInit();
};
} else {
if ($('html').hasClass('check-flash')) {
_V_.options.techOrder = ["flash", "html5", "links"];
if (FlashDetect.versionAtLeast(11, 5)) {
bigVideoInit();
} else {
nonBigVideo(false);
$('#update_player').show();
$('#update_player a.close').click(function(){
$(this).parent().hide();
});
}
} else {
bigVideoInit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment