Created
March 16, 2010 17:53
-
-
Save dsingleton/334292 to your computer and use it in GitHub Desktop.
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"> | |
// Assumed prototypejs installed | |
function video_search(results) | |
{ | |
try { | |
var oEmbedURL = "http://vimeo.com/api/oembed.json?" | |
var params = { | |
callback: 'video_oembed', | |
maxwidth: '480', | |
portrait: 0, | |
title: 0, | |
byline: 0, | |
url: results.responseData.results[0].url.substr(28) | |
}; | |
var script = document.createElement('script'); | |
script.src = oEmbedURL + Object.toQueryString(params); | |
$$('head')[0].appendChild(script); | |
} | |
catch(e) {} | |
} | |
function video_oembed(embed) | |
{ | |
$('embedHole').insert(embed.html); | |
} | |
</script> | |
<script src="http://ajax.googleapis.com/ajax/services/search/video?v=1.0&q=site:vimeo.com Animal collective - My Girls&key=X&callback=video_search"></script> | |
<div id="embedHole"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment