Skip to content Skip to sidebar Skip to footer

Video Current Time Giving Undefined

Hello I have dynamic videos which I tried to get the current video time but I seem to be getting undefined which i don't know why. I fire a function using on time update javascrip

Solution 1:

What you're doing is

var ol = $(e).attr('id');

ol[0].currentTime;

But .attr('id') returns a string, the ID of the element, which clearly doesn't have a currentTime property.

Try doing

$(e)[0].currentTime

instead

Post a Comment for "Video Current Time Giving Undefined"