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

onPlay event triggered twice


Hi.
I'm using the latest commercial player 5.10 and trying to use the Longtail JavaScript API to tracks plays.

Event onPlay is triggered more than once. On the real project this event trigered new event - counter.

Double-counter is triggered.

Help me pleace. How i can resolve this problem?

Example:
http://onmusicstage.com/jw/index.php

In example:
Twice print: "Video is playing!"

Thank you!

12 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Can you update from 5.7 to 5.10 ? – http://www.longtailvideo.com/order/view

JW Player

User  
0 rated :

I'm sorry.
Now on server player v. 5.10.2295.
Adobe flash player v. 11.3.300.226
But the problem still exists.

My Browser FF. On G. Chrome and IE all good.

On other computer, event trigered twice in FF, Chrome and IE.

Thank you!

Ethan Feldman

JW Player Support Agent  
0 rated :

I get this:

Video is buffering…

Video is playing!

Video is buffering…

Video is playing!

JW Player

User  
0 rated :

Hello, Ethan.

Yes!
But I want get only:

Video is buffering...
Video is playing!

Only one onPlay event.
But in this example it trigered twice:
Video is playing! and ... Video is playing!

If event onPlay trigered, then counter listerning this audio must increase on one bc.. (counter = counter+1;)
.
But onPlay trigered twice and counter increase twice. That is wrong.
bc.. (counter = counter+1; counter = counter+1; )


Thank you!

Ethan Feldman

JW Player Support Agent  
0 rated :

If you keep pausing the player and then unpausing it, the play even will be triggered again. It shows up twice because your player buffers twice, that’s all.

JW Player

User  
0 rated :

Double triggering event onPlay occurs only at the beginning of file playback. Can I somehow avoid this?

Or how I can track events start playing a new track to increase its counter listening?

Events Line what I want:
- User Click button Play;
- Buffering Event;
- onPlay event; ====> objAudio.trigger("counter_increase");
- counter_increase; => counter in Database +1;
- if need Buffering Event; but NOT new onPlay event;

Help me please. How i can implement the idea?

Ethan Feldman

JW Player Support Agent  
0 rated :

You can try to remove that part possibly by setting:

‘bufferlength’:‘10’,

JW Player

User  
0 rated :

But when i pausing the player last Event is PAUSED.
I can view last event and if it is PAUSED counter not increase.

JW Player

User  
0 rated :

Ethan, thank you!
I try this solve.

Ethan Feldman

JW Player Support Agent  
0 rated :

Np

JW Player

User  
-1 rated :

'bufferlength':'10', doesn't work.

I decided to have a variable to keep track of triggering event only once.

PS:
player is best!
I wish to develop and improve your project.
Ethan, thank you!

Ethan Feldman

JW Player Support Agent  
0 rated :

Np

This question has received the maximum number of answers.