views:

994

answers:

2

I have a YouTube's player in the webpage. I need to change the video played by this player dynamicaly.

This is (relatively) easy using YouTube's chromeless player. It has method loadVideoById() which works perfectly. The problem is, that the chromeless player doesn't have any controls (play/pause, etc.). The regular YouTube player has all this, but it doesn't have the loadVideoById() method.

Is there any way to include the controls of regular player into chromeless player, or to implement loadVideoById() method in the regular player?

Thanks.

+3  A: 

You can not do that, cause the calls in the "regular youtube player" have the VideoID in the URL instead as a parameter:

Instead of that you can easily create your own function that changes the Embbebed SWF, i mean, say that you are using swfobject for the "Regular Player", then using createSWF function you will be able to replace the previous video for the actual one dynamically.

Hope this help you.

David Santamaria
That's what I tought. Thanks for the answer.
Fczbkk