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

onTime event does not fire


Hey everybody.

First of all, sorry for my poor english.

I'm trying to pause the video at any given time, but is not working.
All other events like *onPlay* and *onComplete* are working fine.

Here is the piece of code that does not work:

bc.. onTime: function(e){
if(e.position == "1.51"){
jwplayer('player').pause();
}
}

3 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Try:

if(e.position >= “1.51”){

JW Player

User  
0 rated :

Hey Ethan,

It works, but when I press play again it keeps pausing automatically.
Probably because the time is greater than the set in the "if" condition.

This code below is working for me, but it is not very efficient.
I just want to pause the vdeo at a certain time.

bc.. onTime: function(e){
if(e.position > 1.51){
this.seek(1.51).pause();
}
}



And for the record, the condition number is unquoted.

Thanks for the help.

Ethan Feldman

JW Player Support Agent  
0 rated :

Cool, glad you got it. Note, I deleted your other comments in this thread, and I am now locking this. Totally unnecessary.

This question has received the maximum number of answers.