saludos gentita, estoy tratando de mostrar un video de youtube en una web de flash.
el video se muestra al darle vista previa en flash pero publicado en el navegador no se muestra. . . adjunto el codigo que encontre en la red.
var ytplayer:MovieClip = _root.createEmptyMovieClip("ytplayer", 1);
var ytPlayerLoaderListener:Object = new Object();
ytPlayerLoaderListener.onLoadInit = function( Void ):Void {
this.loadInterval = setInterval(checkPlayerLoaded, 250);
}
function checkPlayerLoaded( Void ):Void {
if (ytplayer.isPlayerLoaded()) {
ytplayer.addEventListener("onStateChange", onPlayerStateChange);
ytplayer.addEventListener("onError", onPlayerError);
clearInterval(this.loadInterval);
}
}
function onPlayerStateChange(newState:Number):Void {
trace("New player state: "+ newState);
}
function onPlayerError(errorCode:Number):Void {
trace("An error occurred: "+ errorCode);
}
var ytPlayerLoader:MovieClipLoader = new MovieClipLoader();
ytPlayerLoader.addListener( ytPlayerLoaderListener );
// load the player
ytPlayerLoader.loadClip("http://www.youtube.com/v/c9l6huf4qkM&hl=es_ES?&loop=1&autoplay=1", ytplayer);
ytplayer._x =580;
ytplayer._y =65;
ytplayer._xscale=39;
ytplayer._yscale=40;
---------------------------------------
*Si tienes alguna sugerencia se agradece.