return frame number video js?

对着背影说爱祢 提交于 2020-01-05 04:35:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!