Develop with the Official YouTube Chromeless Player AS3 API

View Demo

A few days ago, Google released the official YouTube Chromeless Player AS3 API that gives us an exciting perspective of building flash applications integrating seamless Youtube videos.

Check out their announcement and the YouTube ActionScript 3.0 Player API Reference

Now let’s see a simple example that integrates a YouTube video into an ActionScript 3 Flash application with this API.
1. Create a new flash file (actionscript 3) and save it as youtube.fla. Set the stage size to 640×360 pixels.
Rename “layer 1 ” to “actions” and open the actions panel.
2. Following the YouTube ActionScript 3.0 Player API Reference, copy and paste the following code:

import flash.system.Security;

Security.allowInsecureDomain("*");
Security.allowDomain("*");

// 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…

You Might Also Like...

'>How to create a top quality logo for your company
  • Remove a Section of Your Photo
  • Subscribe to RSS headline updates from: GurusUnleashed
    Powered by FeedBurner

  • Design & Career Resources

    Open design job and RFQ/RFP listings for Thursday, 29 July Courtesy of Design Jobs Live!
    The latest resources and free stuff (like textures, fonts, Photoshop brushes, scripts, plug-ins, and much more!) from workflowFreelance.com. Read more!
    The latest headlines from workflowFreelance.com. Read more!
  • Popular Search Terms

    Curious what others are searching for? Below are the most popular search terms over the last 30 days.