I'm trying to get a Vimeo iframe to 1) disappear when the video ends, and 2) disappear and stop when the user clicks outside the frame.
I've seen a few questions about the first issue, but the Vimeo API is too complicated for my skillset without some specific guidance. The second issue I don't think has been specifically asked.
Here's a fiddle with my preexisting jquery and html stuff.
/*HTML*/
<div class="main_image">
<div id="video"></div>
<a href="#" id="showVideo">
<img src="http://static.ddmcdn.com/gif/11-billion-people.jpg">
<div class="playbutton">
<img class="image" src="http://www.onyxga.com/images/Play-Button.png">
<img class="image hover" src="http://www.clipartbest.com/cliparts/M9c/pjy/M9cpjydTE.png">
</div>
<div id="title">Video Title</div>
</a>
</div>
/*script*/
$('#showVideo').click(function() {
$('#video').show().html('<iframe src="http://player.vimeo.com/video/122447979?title=0&byline=0&portrait=0&color=d01e2f&autoplay=1" width="600" height="300" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>');
});
$(".main_image").mouseenter(function()
{
$(".playbutton").fadeIn(100);
});
$(".main_image").mouseleave(function()
{
$(".playbutton").fadeOut(100);
});