here is the simple code: http://jsfiddle.net/YAFuW/1/
basicly i tried to use like this:
<iframe src="http://player.vimeo.com/video/40977539?api=1" width="400" height="225" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<a href="#">STOP</a>
$('a').click(function() {
alert('stoped');
froogaloop.api('unload');
});
The best way is to work with Vimeo API:
Example:
<script>
var iframe = $('.vimeo-iframe').get(0);
var player = new Vimeo.Player(iframe);
player.pause();
//player.play();
</script>
You missed get the id of the vimeo video:
var iframe = $('#vimeo-player')[0];
var player = $f(iframe);
player.api('unload');
Example: http://jsfiddle.net/joan_r/dutzh512/
<html>
<head>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>
<style>
#play,#pause,#stop{
width:60px;
margin:5px;
text-align: center;
border: solid;
cursor:pointer;
}
</style>
</head>
<body>
<iframe id="vimeo-player" src="//player.vimeo.com/video/76979871" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<div id="play">[PLAY]</div>
<div id="pause">[PAUSE]</div>
<div id="stop">[STOP]</div>
<script>
$('#play').click(function() {
var iframe = $('#vimeo-player')[0];
var player = $f(iframe);
player.api('play');
});
$('#pause').click(function() {
var iframe = $('#vimeo-player')[0];
var player = $f(iframe);
player.api('pause');
});
$('#stop').click(function() {
var iframe = $('#vimeo-player')[0];
var player = $f(iframe);
player.api('unload');
});
</script>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With