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

OTime method in jwplayer


Hey,

I am using onTimeListener on Jwplayer

and using its method:-
public void onTime(long position, long duration)
{
UpdateValue();
}

but this method invokes in 1 seconds approx 10 times.

I want to Update value on every second please suggest me any alternative of onTime method
For that i am easily update the value in every second.

3 Community Answers

George

JW Player Support Agent  
0 rated :

@Override public void onTime(long l, long l1) { double time = Math.floor(l / 1000); double duration = Math.floor(l1 / 1000); if (mOldTime != time) { mOldTime = time; String output = “/// onTime START ///” + “\n” + “Current time:” + “\n” + time + “s” + “\n” + “Total Duration:” + “\n” + duration + “s” + “\n” + “/// onTime END ///”; setOutput(output); } }

Ammy

User  
0 rated :

Can you more explain this solution????

George

JW Player Support Agent  
0 rated :

Get the time, floor the time, check the time against the last floored time, if it’s not the same update the old time and fire your once a second call.

This question has received the maximum number of answers.