Skip to content

Instantly share code, notes, and snippets.

@aenigme
Created August 23, 2010 18:39
Show Gist options
  • Save aenigme/546043 to your computer and use it in GitHub Desktop.
Save aenigme/546043 to your computer and use it in GitHub Desktop.
Embed Vimeo videos with support for iphone and ipad
<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>
@aenigme
Copy link
Author

aenigme commented Aug 23, 2010

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