I'm trying to seek to a specific part of a video, and I'd like to use JQuery.
$('#video').currentTime
gives me undefined. Is there something I'm missing?
(document.getElementById("video").currentTime
works)
It's important to understand that jQuery selector functions return a jQuery object. As such, you cannot access properties directly unless jQuery has a special function set up to handle them.
What you want to do is fetch the currentTime
property so you can use prop()
$('#video').prop('currentTime');
Or, if you're feeling more vanilla:
$('#video')[0].currentTime;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With