Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@normansolutions
Created September 14, 2014 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save normansolutions/2565b3726be0f63e1fc6 to your computer and use it in GitHub Desktop.
Save normansolutions/2565b3726be0f63e1fc6 to your computer and use it in GitHub Desktop.
var mobile = $('#home_template').hasClass('mobile');
if (!mobile) {
var iPadAgent = navigator.userAgent.match(/iPad/i) === null;
var iPodAgent = navigator.userAgent.match(/iPhone/i) === null;
var AndroidAgent = navigator.userAgent.match(/Android/i) === null;
var webOSAgent = navigator.userAgent.match(/webOS/i) === null;
var hasFlash = false;
if (iPadAgent && iPodAgent && AndroidAgent && webOSAgent) {
try {
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if (fo) {
hasFlash = true;
}
} catch (e) {
if (navigator.mimeTypes && navigator.mimeTypes['application/x-shockwave-flash'] !== undefined && navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin) {
hasFlash = true;
}
}
if (hasFlash == true) {
$("#home_banner_feature").html("<style>.embed-container { position: static; padding-bottom: 46.25%; height: 0; overflow: hidden; max-width: 100%; height: auto; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='http://player.vimeo.com/hubnut/album/3005503?color=44bbff&background=ffffff&slideshow=1&video_title=0&video_byline=0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>");
} else {
$("#home_banner_feature").html("<style>.embed-container { position: static; padding-bottom: 46.25%; height: 0; overflow: hidden; max-width: 100%; height: auto; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='//player.vimeo.com/video/103632940' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>");
}
} else {
$("#home_banner_feature").html("<style>.embed-container { position: static; padding-bottom: 46.25%; height: 0; overflow: hidden; max-width: 100%; height: auto; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='//player.vimeo.com/video/103632940' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>");
}
}
@CeciliaD
Copy link

I've been looking for a vimeo hubnut for ios hack, so am going to try this. thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment