Created
September 14, 2014 14:07
-
-
Save normansolutions/2565b3726be0f63e1fc6 to your computer and use it in GitHub Desktop.
For use on blog post: http://normansolutions.co.uk/post/happy-with-a-hack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've been looking for a vimeo hubnut for ios hack, so am going to try this. thank you!