Hello,

Anybody know how it would be possible to upload a youtube frame before it appears with javascript?

Basically, there's an image which is a hyper link. When the image is clicked it changes into the youtube video. Problem is that it takes a while before there is any indication that a youtube is loading up.

I was thinking of maybe loading the youtube video in the background before it is called to appear.

here's what i got:
Code:
window.onload = initLogo;
var ratMovie; // this is going to store the youTbe embeded code.

function initLogo() {
	if(document.getElementById){
		document.getElementById("disjointIntroLink").onclick = playRatatouille;		

// this part is cut and paste from the youtube embed code being assigned to the variable.
ratMovie = '<object width="320" height="192"><param name="movie" value="http://www.youtube.com/v/8eWIEj8FRZo&color1=0xb1b1b1&color2=0xd0d0d0&hl=en_US&feature=player_embedded&fs=1">		</param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/8eWIEj8FRZo&color1=0xb1b1b1&color2=0xd0d0d0&hl=en_US&feature=player_embedded&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="320" height="192"></embed></object>';
		}
	}


function playRatatouille() {
	document.getElementById("intro").innerHTML = ratMovie; //ratMovie snippet integrated in the place of the image click in the HTML.

	return false; // false so the hyperlink attached to the image will not launch, which it will if the user doesn't support javascript.
	}

I check the youtube API features, and didn't find anything with this type of functionality.

anyone have any ideas?