This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 30th, 2012  |  syntax: JavaScript  |  size: 0.72 KB  |  views: 112  |  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. $("#vimeo").ready(onVimeoLoaded);
  8.  
  9. function onVimeoLoaded(player_id)
  10. {
  11.         Froogaloop.init;
  12.  
  13.         console.log('iframe ready');
  14.        
  15.         var iframe = $('#vimeo').get(0),
  16.                 player = $f(iframe);
  17.        
  18.         player.addEvent('ready', function(){
  19.                
  20.                 console.log('ready');
  21.                
  22.                 player.addEvent('pause', onPause);
  23.                 player.addEvent('finish', onFinish);
  24.                 player.addEvent('playProgress', onPlayProgress);                       
  25.         });
  26. }
  27.  
  28. function onPause(id) {
  29.    console.log('paused');
  30. }
  31.  
  32. function onFinish(id) {
  33.         console.log('finished');
  34. }
  35.  
  36. function onPlayProgress(data, id) {
  37.         console.log(data.seconds + 's played');
  38. }
clone this paste RAW Paste Data