AdenForshaw.com Behind the curtain of Affiliate Marketing

2Feb/099

AS3 Youtube player 0.2

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
Comments (9) Trackbacks (0)
  1. 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 ?

  2. 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()

  3. 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

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

  5. 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…

  6. 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

  7. 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.

  8. hey did u save the file from CS4 to CS3?

  9. Robin,

    can you send me a CS3 version?


Leave a comment

(required)

No trackbacks yet.