返回帧号视频js? [英] return frame number video js?

查看:165
本文介绍了返回帧号视频js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何在某个时刻返回视频的帧?

Does anyone know how I can return what frame the video would be on at a certain point ?

所以例如视频正在播放,我按下了制作的js按钮,它返回视频所在的当前帧并将其打印在屏幕上。

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 .

推荐答案

无法从html5视频元素知道视频的确切帧,但如果您知道帧速率(例如,30 fps)你可以进行计算。

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);

这篇关于返回帧号视频js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆