how to play and stop Vimeo video in iframe when click

Html =============

<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>

<iframe id="vimeo-player" src="http://player.vimeo.com/video/40977539?api=1" width="400" height="225" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

<a id="stop" href="#">STOP</a>
<a id="play" href="#">PLAY</a>

Jquery ===========

var iframe = $('#vimeo-player')[0];
var player = $f(iframe);

$('#stop').click(function() {
    alert('stoped');
    player.api('pause');
});


$('#play').click(function(){
    alert('play');
    player.api('play');
})

=================================================

Example - http://jsfiddle.net/zimm/8CV2S/14/

Comments

Popular posts from this blog

Pagination of multiple recent post blog

Service Filter

When You Want to open popup(first time load)