Try using the timeupdate event...
Some rough code....
// Setup jPlayer ready to go...
function playBetween(start,end) {
$('#jplayer').unbind('.endHandler');
$('#jplayer').bind($.jPlayer.event.timeupdate + '.endHandler', function(event) {
if(event.jPlayer.status.currentTime > end) {
$(this).jPlayer('pause',start);
}
});
$('#jplayer').jPlayer('play',start);
}
If you have a progress/play bar you might want to disable clicks on it too.
On Thursday, 30 May 2013 13:08:08 UTC+1, Steven Garcia wrote:
I see that i can specify a start time using the play() method, but is there a way I can get jplayer to stop playing at a specified time? I am providing audio preview/snippets which only let people hear a portion of the mp3. The duration times are all recorded in the database, I just need to plug them into jPlayer somehow.
Any ideas?