AS3 Youtube player 0.2

Monday, February 2nd, 2009 | Actionscript 3, Youtube Player

Get Adobe Flash player

I’ve had a little time to iterate upon my previous demo using Youtube player in AS3.  It’s still not as clean as i’d like, and i haven’t done the Documentation yet, but it’s pretty solid and provides a good example of the methodology invloved.

I’ve only added Play/Pause btn, a clickable Progress bar, and mute button. The AS3 player loads in a AS2 flash movie which wraps the Youtube player and provides an actionable API. The AS@ communicates back to the AS3 player via a call to a pre named function passing all the current properties of the Youtube Player, currentTime, duration, state etc.

Once i get some more time, and i’ve tested it in a couple of applications i’ll finish it off and provide Documentation.

Click to download free source code

Tags: ,

7 Comments to AS3 Youtube player 0.2

ced
February 16, 2009

hello,

Thanks for this great example.

I really like to check the source, unfortunately the “AS3YoutubePlayer.fla” file, can’t open, saying “bad file format”.

I’m trying to open it with CS3 and have downloaded the zip 2 times.

Can you check it or is it a problem from my side ?

Mino
February 17, 2009

really cool but i cant get it to work, this is what i get.

ArgumentError: Send failed because the object is not connected.
at com.gskinner.utils::SWFBridgeAS3/send()
at AS3Holder_fla::MainTimeline/prodPlayer()
at AS3Holder_fla::MainTimeline/onProdPlayerTimer_Timer()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()

admin
February 17, 2009

Sorry CED, the source code is in cs4, i’ll save it out for cs3 when i get a chance tonight and update the post.

Mino, that error looks like it’s coming from trying to call functionality on the AS2 youtube wrapper loaded into the AS3 wrapper before they have connected with a LocalConnection. If you delay any calls you’re making until the load event is complete then you should be fine. If not give me a mail with you’re code and i’ll help you out.

Laters, Aden

ced
February 20, 2009

ok Aden, thanks for your prompt answer.
if you have time to update the file, i’d really like to check it.

Robin van Emden
March 10, 2009

Thanks for your code! I am using the player in one of my projects, works like a charm. It would be great if you’d be able to include the AS2YouTubePlayer.fla in your download. I’d like to adapt the code for use with multiple concurrent connections…

Coder
March 30, 2009

You should start using this wrapper, which doesn’t have issues with volume in IE and supports multiple instances on the same page: http://www.ovidiudiac.ro/blog/?p=70

GertjanS
May 12, 2009

Hey, thanks for the code!

It works, kinda (just starting to figure it out)
I would like the as2 fla aswell, you hardcoded the api key in there?

Thanks.

Leave a comment

Search