Advertisement
Imperative-Ideas

A jQuery example of the Vimeo JS API using $(this)

Jun 14th, 2014
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.72 KB | None | 0 0
  1. // Set up Froogaloop (Vimeo API)
  2.     if (typeof mod_apicall !== 'undefined' && mod_apicall == 'vimeo' ) { // check to make sure the video exists
  3.         var iframe = document.getElementById('thevideo');
  4.         var player = $f(iframe);
  5.  
  6.         $('.timecode').on('click', function (e) { // this targets actual .timecode links and grabs the data value
  7.             e.preventDefault();
  8.             var seekVal = $(this).attr('data-seek');
  9.             player.api('seekTo', seekVal);
  10.         });
  11.  
  12.         $('.jumper').find('select').on('change', function (e) { // this targets the .jumper select box and fires on change
  13.             var seekVal = $(this).attr('value');
  14.             player.api('seekTo', seekVal);
  15.         });
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement