Created
June 30, 2015 22:14
-
-
Save lucasmlessa/755c7228c0cc379869b8 to your computer and use it in GitHub Desktop.
Revisions
-
lucasmlessa created this gist
Jun 30, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ Security.allowDomain("www.youtube.com"); var videoPlayer: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 { youTuba.addChild(loader); // MovieClip (Objeto) onde será carregado o vídeo loader.content.addEventListener("onReady", onPlayerReady); } function onPlayerReady(event:Event):void { trace("Ready"); videoPlayer = loader.content; videoPlayer.setSize(220, 120); // Tamanho do vídeo videoPlayer.cueVideoByUrl("http://www.youtube.com/v/OUdoEoy2dbo", 0);// Endereço do vídeo }