I have hit a wall and cannot figure out how to make this work. With Vimeo's Advanced API I am pulling in all videos from an account with thumbnails. When clicking on a thumbnail the video is shown above and clicking on a different thumbnail hides the currently shown video. The problem is that the video continues to play even when it is hidden. I have spent a few hours looking at the API and I cannot get it to pause when hidden.
var iframe = $('.video')[0];
$('.thumbnail a').click(function(e) {
$f(iframe).api('pause');
});
The above code pauses only the first video. If I change the number [0] to [1], then the second video pauses when you click on another thumbnail. Does anyone have any thoughts? I am using froogaloop in the above code.