OK, I'm completely stuck. I'm really hoping that someone out there might have experience loading Vimeo videos with Vimeo's Froogaloop API.
I can't seem to get the 'ready' event to catch.
Froogaloop:
<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>
My script:
$.getJSON('http://www.vimeo.com/api/oembed.json?url=' + encodeURIComponent('http://vimeo.com/27027307') + '&width=300&callback=?', function(data){
$('#video-container').html(data.html); //puts an iframe embed from vimeo's json
$('#video-container iframe').ready(function(){
player = document.querySelectorAll('iframe')[0];
$f(player).addEvent('ready', function(id){
console.log('success');
});
});
});
The video loads fine. This is the message I'm getting in the console:
Uncaught TypeError: Cannot read property 'ready' of undefined
I need to use event listeners for detecting pauses, etc. I saw this post, but unfortunately, the main difference is that I'm loading dynamically via JSON. Also, Vimeo has a working example of the Froogaloop in action, but not with jQuery.
Thanks in advance!!!