Stopping youtube video once it reaches a point
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.
精彩评论