after extensive research i couldn't find an answer that fitted my (fairly) low skills in javascript. it'd be a great relief if any of you could help.

i'm trying to run this script twice on the same page but i think the problem is the function onYouTubePlayerReady cannot be called two times without having it overwritten by the last.
Also, if I change its name the actual functions won't be performed.

here's the code. I'd like it to play up to 4 youtube videos with no sound and autoplay in the same page. do you know how it's possible?

I see a couple of things that might be problematic, e.g. ytplayer is global and not local to the function. Also, you make the function accept an argument but it is not using it. You have two identical pieces of code. Are you saying using both does not work? Or do you have problems using the original onYouTubePlayerReady function for both videos?
–
Felix KlingOct 8 '11 at 23:03

I don't know, as I said, there seem to be a couple of problems. E.g. you have no elements with IDs myytplayer2 or myytplayer. onYouTubePlayerReady2 will never be called as the API does not know about this function.
–
Felix KlingOct 8 '11 at 23:10

the second script works as it should using them at the same time
–
michele post-duranteOct 8 '11 at 23:12

i can see the embed elements having those myytplayer Ids, and if onYouTubePlayerReady2 is not recognized, how can i run it for the two elements (the embed videos)?
–
michele post-duranteOct 8 '11 at 23:16