Youtube API seekTo() in float seconds

后端 未结 1 979
既然无缘
既然无缘 2021-01-05 14:03

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

相关标签:
1条回答
  • 2021-01-05 14:42

    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

    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.

    0 讨论(0)
提交回复
热议问题