Friday, March 9, 2012

[YouTube-API] Re: iFrame API and YT.Player

HI Jeff,
  Figured out the issue, the video is loaded by creating a new instance of YT.Player. This object does indeed provide the APIs required (getCurrentTime and getDuration). My issue however was that the tracking code was creating it's own YT.Player object using the playerID, that object however does not have the required APIs.

Gist with sample (improper use):  https://gist.github.com/2007137 

cheers,
Marc.

On Wednesday, March 7, 2012 2:53:18 PM UTC-5, Jeffrey Posnick wrote:
Hello Marc,

 Those are not safe to use, no. Both the getCurrentTime() and
getDuration() methods of YT.Player should be supported for both HTML5
<video> and Flash playback. I just tried them and was able to use
them. Could you provide a URL that we could visit to reproduce the
issue you're seeing?

Cheers,
-Jeff Posnick, YouTube API Team
groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
@YouTubeDev


On Mar 6, 11:31 am, Marc Gagné <marc.ga...@gmail.com> wrote:
> Trying to get the current time and the duration while using the new iFrame
> embed code & YT.Player. There does not appear to be any support for the
> JavaScript API methods of player.getCurrentTime() and player.getDuration().
>
> I did find the required information in event.target.e.currentTime and
> event.target.e.duration (where event is the event data for onStateChange ).
> This does not appear to be documented anywhere, is it safe to use? Is there
> a better approach?
>
> cheers,
> Marc.

--
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/-/71Spri4p6CoJ.
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