问题
Does anyone know how I can return what frame the video would be on at a certain point ?
so for example the video is playing and I press a js button ive made and it returns the current frame the video is on and prints it on screen .
回答1:
There's no way to know the exact frame of the video from the html5 video element, but if you know the frame rate (e.g. 30 fps) up front you could do the calculation.
var frame = Math.floor(myPlayer.currentTime() * frameRate);
来源:https://stackoverflow.com/questions/17593982/return-frame-number-video-js