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

Callback function executed on play


A callback function similar to Yourlytics (no longer supported in JW5) which would allow you to increment a view counter or perform any other task. There is currently no way to increment a video views counter which is essential to almost any video sharing website.

The ability to detect the state would be nice, but even a simple one time script on play would be perfect.

3 Community Answers

JeroenW

JW Player Support Agent  
0 rated :

Have you looked at the onPlay() JavaScript callback? That should be exactly what you’re looking for. Here’s a simple example:

http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/16024/listening-for-player-events

JW Player

User  
0 rated :

The onPlay() callback does not work for counting views. The onPlay is called each time the video is paused and played again, this results in multiple requests for one instance. Is there another option? I am using onComplete right now to create my views but would like to be creating them at the beginning.

JeroenW

JW Player Support Agent  
0 rated :

The onPlaylistItem() event is only sent out once for each video. That’ll indeed be better than onPlay().

This question has received the maximum number of answers.