Youtube API seekTo() 浮点数 [英] Youtube API seekTo() in float seconds

查看:17
本文介绍了Youtube API seekTo() 浮点数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Youtube API seekTo 函数接受浮点时间还是帧时间?你能向下钻取到小数点后两位吗?

Does the Youtube API seekTo function accept time in float or in frames? Can you drill down up to two decimal places?

推荐答案

是的,API 完美接受了 float 中的 seekTo 时间;它将前进到您的浮动之前最近的关键帧,无论它可能是什么.这是一个演示:

Yes, the API accepts seekTo time in float perfectly; it will advance to the closest keyframe before your float, whatever that may be. Here's a demonstration:

http://goo.gl/E4jzu

寻找帧有点棘手,因为不同的视频具有不同的 fps 速率.由于您无法通过 API 获取 fps(除非有我不知道的方法?),因此尝试编写一个可以将您想要寻找的帧转换为浮点数的包装器太难了.但是,如果它们是您的视频,并且您知道 fps 速率,那将是微不足道的.

Seeking to a frame is a little trickier of a beast, as different videos have different fps rates. Since you can't get the fps via the API (unless there's a method I don't know?), it would be too difficult to try to write a wrapper that could convert the frame you want to seek to into a float. If they are your videos, though, and you know the fps rate, it would be pretty trivial.

这篇关于Youtube API seekTo() 浮点数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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