So I found the following code online which allows me to embed my youtube video into flash and it works just as it should but I don't have the option of Close Captioning which I need. Is there anyway to make this happen? I don't know anything about ActionScript so please keep that in mind. I also am not sure how to get the embedded video to center on the stage which I would really like to do. I'm working in Flash CS6 with AS3.
Thanks ahead of time for any help.
Code |
---|
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 { addChild(loader); loader.content.addEventListener("onReady", onPlayerReady); }
function onPlayerReady(event:Event):void { trace("Ready"); videoPlayer = loader.content; videoPlayer.setSize(854,480); videoPlayer.cueVideoByUrl("http://www.youtube.com/v/zSRBCKVbad0", 0); } |