Last active
August 29, 2015 14:11
-
-
Save ethyde/6483d85450b3c7653dca to your computer and use it in GitHub Desktop.
Vimeo Player JS API http://developer.vimeo.com/player/js-api et https://github.com/vimeo/player-api/tree/master/javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Ajouter le script froogaloop à la page --> | |
<script src="//f.vimeocdn.com/js/froogaloop2.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var iframe = $('#frame_id'); | |
var player = $f(iframe[0]); | |
player.addEvent('ready', function() { | |
console.log('ready'); | |
player.api('play');// trigger play video | |
player.api('setColor', '#000'); // define color | |
player.addEvent('play', onPlay); | |
player.addEvent('pause', onPause); | |
player.addEvent('finish', onFinish); | |
player.addEvent('playProgress', onPlayProgress); | |
}); | |
function onPlay(id) { | |
console.log('paused'); | |
} | |
function onPause(id) { | |
console.log('paused'); | |
} | |
function onFinish(id) { | |
console.log('finished'); | |
} | |
function onPlayProgress(data, id) { | |
console.log(data.seconds + 's played'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment