Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Detecting playlist item skip


Hi! I recently switched to JW player 7 (will buy the full licence after development is complete) and we are building a commercial platform to play lists of mp3s or videos. The (logged in) users will be able to skip up to a certain amount of songs per hour (because of canadian laws and copyrights).

I would like to know if there is a way to detect that and then execute some javascript code where I could count the number of skips in an hour and reset it every hour.

I'm comfortable with writing the javascript, but I'm having trouble to figure out how to detect the skips in the player.

Thanks!

4 Community Answers

George

JW Player Support Agent  
1 rated :

Hi,

I added an event listener to the DOM element, works for me:
http://qa.jwplayer.com.s3.amazonaws.com/~george/detect_skip.html

j...

User  
0 rated :

Thanks, George, it works great, but how can I prevent the next skip?

Is there a way to disable the button or hide the controls until I want them back (with javascript)? Or to just not skip the next time the button is clicked?




j...

User  
0 rated :

I have managed to do something with setControls(false). If you have better ideas, please share. Thanks so much for your help, it gave me a good push in the right direction!

George

JW Player Support Agent  
0 rated :

I’d probably use CSS to hide the button

.jw-icon-next{
display: none !important;
}

This question has received the maximum number of answers.