Muricium 0 Denunciar post Postado Setembro 1, 2010 Ola pessoal, estou com um site em flash e preciso carregar nele um video que esta no youtube, procurei várias coisas e quebrando a cabeça, só cheguei num ponto que nao consigo ver onde esta o problema. alguem pode dar um help? Segue código: Security.allowDomain("www.youtube.com"); // This will hold the API player instance once it is initialized. var player:Object; var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit); loader.load(new URLRequest("http://www.youtube.com/apiplayer?version=3")); function onLoaderInit(event:Event):void { addChild(loader); loader.content.addEventListener("onReady", onPlayerReady); loader.content.addEventListener("onError", onPlayerError); loader.content.addEventListener("onStateChange", onPlayerStateChange); loader.content.addEventListener("onPlaybackQualityChange", onVideoPlaybackQualityChange); } function onPlayerReady(event:Event):void { // Event.data contains the event parameter, which is the Player API ID trace("player ready:", Object(event).data); // Once this event has been dispatched by the player, we can use player.loadVideoByUrl("http://www.youtube.com/watch?v=6C2RonYwPg4", 0); // to load a particular YouTube video. player = loader.content; } function onPlayerError(event:Event):void { // Event.data contains the event parameter, which is the error code trace("player error:", Object(event).data); } function onPlayerStateChange(event:Event):void { // Event.data contains the event parameter, which is the new player state trace("player state:", Object(event).data); } function onVideoPlaybackQualityChange(event:Event):void { // Event.data contains the event parameter, which is the new video quality trace("video quality:", Object(event).data); } abs Compartilhar este post Link para o post Compartilhar em outros sites
Irineu Antunes 2 Denunciar post Postado Setembro 23, 2010 Tentei utilizar a API do you tube: http://code.google.com/apis/youtube/overview.html Compartilhar este post Link para o post Compartilhar em outros sites