Skip to content

Instantly share code, notes, and snippets.

@brianng
Created March 8, 2012 10:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianng/2000342 to your computer and use it in GitHub Desktop.
Save brianng/2000342 to your computer and use it in GitHub Desktop.
Minimal Vimeo Javascript API example
/*
* Play an embedded video and trigger a callback when finished playing (using jQuery).
*
* Vimeo JavaScript library
* http://vimeo.com/api/docs/player-js
* https://github.com/vimeo/player-api/tree/master/javascript
*/
var vimeo = $f('vimeo'); // id of iframe or iframe element
vimeo.addEvent('ready', function() {
vimeo.api('play');
vimeo.addEvent('finish', function() {
console.log('finished');
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment