YouTube announces Upload API, Chromeless Player with JavaScript API and H.264 videos

YouTube has announced a lot of new features:-

This is really amazing, we can build kick-ass applications that would use YouTube’s platform for media upload, conversion (trans coding) and delivery, seamlessly.

I am yet to confirm, how easy it is to load and control YouTube’s player in our Flash/Flex apps? Controlling loaded SWFs is hard, unless it allows cross-site scripting through Security.allowDomain (“loaderdomain.com”). I hope, some day Flash Player would have more Security APIs, which would let us expose a set of interfaces to loaders (SWF loads another swf from different domain).

In any case, we can overlay iframe/div to show the video. That’s what I am doing for Yahoo! Live Mashup.

Update (March 12, 2008): YouTube’s chromeless player can be loaded in Flash/Flex applications and can be controlled. That’s what I heard Geoff Stearns, Flash Engineer in YouTube and SWFObject developer, saying in this video.

Technorati Tags: , , , , , , ,

  • Currently the chromeless / embed player Flash API is limited to as2 apps, but it would be fairly easy to write a little wrapper that uses LocalConnection to talk between an as3 app and the player. I believe one of the 3rd party developers wrote one during our beta period, but I’m not sure if they posted it anywhere.
    As for exposing specific APIs to parent swf apps, here’s how I did it with the YouTube players:
    We use two swfs – one is a very small loader swf witch allows any domain to make calls to it, then we have our main player swf which doesn’t allow any other domains to make calls (the loader swf and the player swf are in the same domain, so they can talk to eachother).
    When the player swf loads into the loader swf, it registers some public API calls which are then accessible from any domain. So we keep our main player private, but can expose any functions we like by adding references in the loader swf.
    I’m very interested in hearing feedback from Flash devs about this new API, so don’t hesitate to shoot me an email or post a comment on my blog about your experiences.

  • @Geoff, Thanks for more updates. I noticed AS2 thingy and infact wrote similar thing in youtube-gdata mailing list to update other flash devs about LocalConnection/ExternalInterface options of using chromeless player in AS3/Flex Apps.
    I am gonna play with the API and surely let you know of feedbacks.

  • Any code examples on how to use the chromeless player in combination with Flex would be more than appreciated as I’m not a Flash developer šŸ™

  • @Tom: Last night, I spent a lot of time writing a wrapper but realized chromeless player doesn’t initialize properly when loaded in SWFLoader or Loader. Reason, it fails to resolve AS2 classes com.blah.blah. I remember, I had fixed something similar in past while loading SlideShare player (which is also in AS2 with lots of _level0 and _root references).
    I am not sure, if YouTube’s chromeless player is defining all it’s classes in _global scope. I tried locking the root (_lockroot = true), no success…
    I am gonna give some more try and probably update here or a new post.
    Thanks
    -abdul

  • Sam

    Recently I have found that the FLV path to youtube videos have been changed. Since about a month a new format is being used:
    http://dal-v35.dal.youtube.com/get_video?video_id=gXQokBx0NJE&signature=C05B0CB57D538ADD83B942D0979E1BFC844CFD9A.B2ADC6CAB7D998D7743E910F6E0B67A4A6EC0CEE&ip=67.15.14.65&ipbits=16&expire=1205800518&key=yt1&sver=2
    Now there is no way to get a permanent link to an flv. This one will expire after a certain amount of time. Before it was simply:
    http://dal-v35.dal.youtube.com/get_video?video_id=gXQokBx0NJE
    Abdul, since you have previously wrote on how to get the flv paths, any ideas on how to get a permanent link back? Thanks.