Created
August 23, 2010 18:39
-
-
Save aenigme/546043 to your computer and use it in GitHub Desktop.
Embed Vimeo videos with support for iphone and ipad
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
<script type="text/javascript"> | |
var agent=navigator.userAgent.toLowerCase(); | |
var is_iphone = (agent.indexOf('iphone')!='-1'); | |
var is_ipad = (agent.indexOf('ipad')!='-1'); | |
if (is_iphone) { | |
document.write("<video src='http://www.vimeo.com/play_redirect?clip_id=00000000&quality=mobile' controls='controls' width='000' height='000'></video>"); | |
} | |
else if (is_ipad) { | |
document.write("<video src='http://www.vimeo.com/play_redirect?clip_id=00000000' controls='controls' width='000' height='000'></video>"); | |
} | |
else { | |
document.write("<object width='000' height='000'><param name='allowfullscreen' value='true' /><param name='allowscriptaccess' value='always' /><param name='movie' value='http://vimeo.com/moogaloop.swf?clip_id=00000000&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=ffffff&fullscreen=1' /><embed src='http://vimeo.com/moogaloop.swf?clip_id=00000000&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=ffffff&fullscreen=1' type='application/x-shockwave-flash' allowfullscreen='true' allowscriptaccess='always' width='000' height='000'></embed></object>"); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://www.squaregirl.com/vimeo-html5