Google FINALLY Releases AS3 Player for YouTube

Absolutely wonderful that Google has finally released an AS3 version of their chromeless player for use in Flex/AS3 projects. No more weird proxy hacks!!!

I’ve thrown together a quick example and have posted the code below. Really simple stuff to set up and use. Google seems to be more and more friendly to the Flash world lately. There are at least two major projects I’m going to implement this in as soon as I get the time to do so. Very nice- I’m quite pleased!

View the Example:
[SWF]http://inflagrantedelicto.memoryspiral.com/wp-content/uploads/2009/10/YouTubeAS3.swf, 480, 500[/SWF]

References:
The ActionScript 3 YouTube Chromeless Player is Now Live
YouTube ActionScript 3.0 Player API Reference

Download the Example:
YouTubeAS3.fxp

View Code for Flash Builder 4:



	
		
	
	
		
	
	
	
	
	

12 thoughts on “Google FINALLY Releases AS3 Player for YouTube”

  1. Hi,

    I’m looking for a way to integrate a YouTube movie into my Flash application (being able, of course to load, play, pause, get events etc).

    I’d appreciate any help on this issue,
    Thanks,
    EZ

  2. Hi,
    very useful…
    I try to integrate your code in a Flash Application with no success :-(
    An error occured :
    *** Security Sandbox Violation ***
    SecurityDomain ‘http://inflagrantedelicto.memoryspiral.com/2009/10/google-finally-releases-as3-player-for-youtube/’ tried to access incompatible context…

    Any idea ?

  3. @Joseph :
    Your exemple trigger a sandbox error too ;-)

    *** Security Sandbox Violation ***
    SecurityDomain ‘http://www.youtube.com/apiplayer?version=3’ tried to access incompatible context ‘http://inflagrantedelicto.memoryspiral.com/2009/10/google-finally-releases-as3-player-for-youtube/’

    I fixed the problem with including this :
    Security.allowInsecureDomain(“*”);
    Security.allowDomain(“*”);

  4. “Security Sandbox Violation” is more of a warning message than an error. If I recall, this is expected behavior when running against YouTube stuff even in the AS2 player. Those security settings may remove the message locally, but when on a webserver it shouldn’t matter.

    Also keep in mind that this example was whipped together the night Google released the API and I must have spent all of 15 minutes on the example ;)

  5. @Joseph,

    I too got the “Security Sandbox Violation” error…

    I’d really appreciate a simple CS4 file, if it is not too much trouble…

    Thanks a lot,
    EZ

  6. Pingback: YouTube AS3 Example Using Flash Professional | In Flagrante Delicto!

  7. @Joseph

    Working great!
    Thanks a lot.

    One more question:
    I’m trying to sync YouTube’s movie with events in my game.
    When I use the player.getCurrentTime() method I notice that it gets updated only every ~0.1 sec (which is a low rate).

    Does anyone knows if it is possible to get updates at a higher rate?

    Thanks,
    EZ

Leave a Comment

Your email address will not be published. Required fields are marked *