开发者

Stopping youtube video once it reaches a point

开发者 https://www.devze.com 2022-12-10 05:06 出处:网络
It looks like the YouTube API does not have a way to stop a video playing开发者_如何学C once it reaches a certain point. It has a way to start it at a certain point, but not to stop it at a certain po

It looks like the YouTube API does not have a way to stop a video playing开发者_如何学C once it reaches a certain point. It has a way to start it at a certain point, but not to stop it at a certain point. I'm wondering if there's a workaround for this? or maybe I glanced over it without noticing.


You could do some repetitive polling of the time elapsed with player.getCurrentTime() and then when it reaches the point you want, call player.stopVideo(). If that's a little too busy, you could use a timer and only start polling after a certain time had elapsed.

0

精彩评论

暂无评论...
验证码 换一张
取 消