I'm trying to embed multiple youtube videos in a single web page using the chromeless player. This isn't multiple videos in the same player, this is multiple players on a single page.
Here is an example. (only the last video shows up):
<div>
<div id="ytapiplayer">
You need Flash player 9+ and JavaScript enabled to view this video.
</div>
<script type="text/javascript">
var params = { allowScriptAccess: "always" };
var atts = { id: "myytplayer" };
swfobject.embedSWF("http://www.youtube.com/apiplayer?enablejsapi=1&version=3&playerapiid=1234","ytapiplayer", "499", "281", "9", null, null, params, atts);
function onYouTubePlayerReady(playerId) {
ytplayer = document.getElementById("myytplayer");
ytplayer.cueVideoById("Zhawgd0REhA");
}
</script>
</div>
<div>
<div id="ytapiplayer2">
You need Flash player 9+ and JavaScript enabled to view this video.
</div>
<script type="text/javascript">
var params = { allowScriptAccess: "always" };
var atts = { id: "myytplayer2" };
swfobject.embedSWF("http://www.youtube.com/apiplayer?enablejsapi=1&version=3&playerapiid=4321","ytapiplayer2", "499", "281", "9", null, null, params, atts);
function onYouTubePlayerReady(playerId) {
ytplayer2 = document.getElementById("myytplayer2");
ytplayer2.cueVideoById("qkAn_qJdgBs");
}
</script>
</div>
Any help would be greatly appreciated.