Wednesday, July 11, 2012

[YouTube-API] Re: Pausing Video After Seek

Hi PIR,
 
Have you tried the solution on a Mac. I had trouble getting a programatic pauseVideo() to work after a seek on that platform (still not done) ?

On Tuesday, July 10, 2012 6:09:02 PM UTC+1, PIR wrote:
Update: For posterity I'm going to post the solution I came up with.

I was able to get the desired behavior by tracking the last playback state the player was in and if it matches the current playback state when onPlayerStateChange is called, pausing the video. This works because it seems that while seeking, onPlayerStateChange is called, but the playback state remains the same (1 for 'playing').

It's ugly and it's a dirty solution, but it works and I was able to do it within the time frame I had available.

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/youtube-api-gdata/-/hTCpYPoIcDsJ.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment