Change (August 2014) . I recently wrote a jQuery Vimeo plugin that basically solves this problem much more elegantly. But the solution, if you are hard coding, is below:
When downloading a Vimeo video, you must include the &api=1 query string in the URL. This allows you to make API calls. Vimeo also requires &player_id=SOME_ID if you intend to upload multiple videos that must match the iframe ID that it uploaded (or, in my case, use jQuery to add it to the iframe after loading JSON, as I am creating it dynamically.)
I lost half a day on this. Here is what my final code came out if it is useful for anyone trying to download a Vimeo video dyanmically.
Using Vimeo Froogaloop Infrastructure
<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>
my js
var videoData = [ { 'title':'The Farm', 'id':'farmvideo', 'videoURL':'http://vimeo.com/27027307' }]; $.getJSON('http://www.vimeo.com/api/oembed.json?url=' + encodeURIComponent(videoData[0]['videoURL']) + '&api=1&player_id='+ videoData[0]['id'] +'&width=300&callback=?', function(data){ $('#video-container').html(data.html); //puts an iframe embed from vimeo json $('#video-container iframe').load(function(){ player = document.querySelectorAll('iframe')[0]; $('#video-container iframe').attr('id', videoData[0]['id']); $f(player).addEvent('ready', function(id){ var vimeoVideo = $f(id); console.log('success'); }); }); });
source share