How to access youtube api via javascript

seaship - June 24, 2009 - 03:30

I've spent a fair amount of time searching for the answer but haven't found it. Maybe that means its obvious.

Anyway.

My goal is to embed a video page, then while it is playing query where it is in the video based on user input. Initially I just want to do this with youtube videos but eventually from other sources as well. So if for now the solution is youtube specific then fine. The youtube api supplies all the methods necessary to do this, I am just missing the bit of context to make all this work. How do I do this?

Thanks.

"...while it is playing query

mm167 - June 24, 2009 - 05:04

"...while it is playing query where it is in the video based on user input."

what is the meaning of the above line?

We go the drupal way. How about you?
http://www.drupalway.com

Sorry, there should be a

seaship - June 24, 2009 - 16:14

Sorry, there should be a comma after 'playing'.

It means while the video is playing, the user may press buttons or keys and at that time I would like to query the player's present location in the video. (via javascript) So, if it is a youtube video, I would call the youtube api method getCurrentTime().

The thing I don't understand is if I use CCK and embed a video field, how do I 1) add the javascript and 2) get the id of the player? If it is a regular page I could call drupal_add_js(), but I do not see how to add arbitrary PHP to a page created with the CCK.

as u have already found the

mm167 - June 25, 2009 - 00:44

as u have already found the api getCurrentTime(), it is a piece of cake.

but i dont think this piece of cake is available in "drupal supermarket" (i.e. drupal modules), u may have to make it by yourself.

if u put this request in "Paid Service", I believe many people will build a demo for u for US$10 (paypal).

by the way, why u need the current time?

good day.

We go the drupal way. How about you?
http://www.drupalway.com

 
 

Drupal is a registered trademark of Dries Buytaert.