Time event callback bound multiple times when pausing/resuming
Hullo,
JWPlayer 7.9.3 Seems that on('time') callback is bound again every time user pauses/resumes the video. Not a huge issue as we debounce our logic anyways because the event is triggered frequently, but seems to be a bug.
Just to confirm, are you saying that pausing and then resuming playback results in the the .on(‘time’) event firing multiple times per instance?
For example, let’s say I have console.log(“Time event fired.”); running every time the .on(‘time’) event fires. Are you saying the following is happening:
Begin playback the first time, a console.log is printed once per .on(‘time’) event.
I pause and resume playback, now a console.log is printed twice per .on(‘time’) event.
I pause and resume playback again, now a console.log is printed three times per .on(‘time’) event.
Thank you for that information. I am unable to reproduce the behavior on a test page. Even after pausing and resuming, the .on(‘time’) event is only posting once per fire into the console.
Are you still seeing that behavior? If so, what browser and operating system are you using? Can you provide a URL to a reproduction page?
This was not really troubling us, as we debounce our logic anyways - just a funny behaviour I noticed and thought I'd share. I can no longer reproduce this either, so might have been something in our own code. Sorry for the false alarm.