I'm using Views to print out the jPlayer in a row along with some other info. How would I use jQuery to access the jPlayer object so that I can attach event handlers? In particular, I want to set a handler for the $.jPlayer.event.ended event.

I tried something like this but it doesn't do anything:
$('.jplayer').bind($.jPlayer.event.ended, function() { alert('a'); });

Any thoughts? Thanks!

Comments

neotohin’s picture

This worked for me.

jQuery('.jp-jplayer').bind(jQuery.jPlayer.event.ended +'.jp-repeat', function() { 
		alert('yes');
	});
deviantintegral’s picture

Status: Active » Fixed

#1 will work. See lines 11 and 13 from jplayer-protect.js for another example.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.