-
How To Position Youtube Chromeless Player
Hey Guys
So I'm embedding a youtube chromeless player in to my website via actionscript 3, and I found this code that works fine -
import flash.system.Security;
Security.allowInsecureDomain("*");
Security.allowDomain("*");
var player:Object;
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.IN IT, 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("onPlaybackQuality Change", onVideoPlaybackQualityChange);
}
function onPlayerReady(event:Event):void {
trace("player ready:", Object(event).data);
player = loader.content;
player.loadVideoById("Cmezvqikanc")
player.setSize(640, 360);
}
function onPlayerError(event:Event):void {
trace("player error:", Object(event).data);
}
function onPlayerStateChange(event:Event):void {
trace("player state:", Object(event).data);
}
function onVideoPlaybackQualityChange(event:Event):void {
trace("video quality:", Object(event).data);
}
but I need to be able to position the player, and at the moment its anchored to the top left corner, didnt want to play about with the code without knowing what to do, also how easy would it be to add simple controls? play, pause, mute, replay
-
You can just add:
player.x=80;
player.y=170;
under the setSize... That should do it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|