Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html5 video player progress bar click funcion

Is it possible to listen on html 5 video player default progress bar click using j query having specific video tag id? video tag is like

<video width="250" height="150" id="videoplayer" controls="" autoplay="" src="blob:https%3A//fiddle.jshell.net/91a12a0d-f082-4fbd-a70c-7fa94563690c"></video>

can i get click event of id="videoplayer" on progress bar

like image 432
Albin Mathew Avatar asked Nov 27 '25 08:11

Albin Mathew


2 Answers

All the set of events possible to track are listed at the link mentioned:- Link:- http://www.w3schools.com/tags/ref_av_dom.asp

Example:- https://www.w3.org/2010/05/video/mediaevents.html

I hope this would help you.

Thanks and Regards Kautuk Sahni

like image 143
kautuksahni Avatar answered Nov 29 '25 21:11

kautuksahni


Try the "seeking" event. It will be called if you click on the progress bar.

let videoPlayer = document.getElementById('videoPlayer');
videoPlayer.addEventListener("seeking", function(){
  console.log('seeking', videoPlayer.currentTime)
});
like image 23
Feng Liu Avatar answered Nov 29 '25 21:11

Feng Liu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!