Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 30th, 2012  |  syntax: JavaScript  |  size: 0.64 KB  |  views: 257  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var vimeo='<iframe id="vimeo" src="http://player.vimeo.com/video/........
  2.  
  3.  
  4. // Add video
  5. $("body").html( $("body").html() + vimeo);
  6.  
  7. var iframe = $('#vimeo').get(0),
  8. player = $f(iframe);
  9.  
  10. player.addEvent("ready", onVimeoLoaded);
  11.  
  12. function onVimeoLoaded(player_id)
  13. {
  14.         Froogaloop.init;
  15.  
  16.         console.log('ready');
  17.        
  18.         player.addEvent('pause', onPause);
  19.         player.addEvent('finish', onFinish);
  20.         player.addEvent('playProgress', onPlayProgress);
  21. }
  22.  
  23. function onPause(id) {
  24.    console.log('paused');
  25. }
  26.  
  27. function onFinish(id) {
  28.         console.log('finished');
  29. }
  30.  
  31. function onPlayProgress(data, id) {
  32.         console.log(data.seconds + 's played');
  33. }