View difference between Paste ID: M8zxFsSS and ApDBsWmM
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);
7+
var iframe = $('#vimeo').get(0),
8
player = $f(iframe);
9
10
player.addEvent("ready", onVimeoLoaded);
11
12
function onVimeoLoaded(player_id)
13-
	var iframe = $('#vimeo').get(0),
13+
14-
		player = $f(iframe);
14+
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
}