SHOW:
|
|
- or go back to the newest paste.
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 | - | console.log('ready'); |
16 | + | |
17 | ||
18 | - | player.addEvent('pause', onPause); |
18 | + | player.addEvent('ready', function(){ |
19 | - | player.addEvent('finish', onFinish); |
19 | + | |
20 | - | player.addEvent('playProgress', onPlayProgress); |
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 | } |