Home

Archive » June, 2008 «

Flex YouTube API Example Update

Monday, June 30th, 2008 | Author:

Added a Comments viewer, and a related movies tab using the as3-youtube-data-api

View the flex swf here

Loading the comments is almost identical to loading the feeds – just use these classes :
import ca.newcommerce.youtube.data.CommentData;
import ca.newcommerce.youtube.feeds.CommentFeed;
import ca.newcommerce.youtube.events.CommentFeedEvent;

The rest is the same.

Previous version with source code here

Category: Flash, YouTube API | 3 Comments

YouTube API Resources

Wednesday, June 25th, 2008 | Author:

Posting just to keep some of the resources linked in a single post – will add to this list as further resources are found:

—===General===—
YouTube Announcement

YouTube APIs Developer Forum

YouTube Data API FAQ

—===Flex AS3 Related===—
as3-youtube-data-api

Youtube Data API AS3 – Tutorial

Martin Legris’ Blog (as3-youtube-data-api author)

more links

—===Flex Examples===—
as3-youtube-data-api usage example(with source code)

Example Flex YouTube Player(with source code)

—===fin===—

Update: No need for Developer Key to load the chromeless player from now on the new chromeless player URL is: http://www.youtube.com/apiplayer

Category: YouTube API | Comments off

Flex YouTube API Example Feed + Search Display

Wednesday, June 18th, 2008 | Author:

Flex YouTube API feed + search display. download source code here

Uses library @ as3-youtube-data-api

Nice player example @ on_the_other_hand

author of as3-youtube-data-api has a blog @ blog.martinlegris.com

update: added in a simple player to view the movies.

.
Update 2: Added source code download for the feed display
We are making a Cairngorm version of this but here is a simple component version to test.
The source code for the feed display component (not the player) is here
It is a FlashDevelop3 Beta7 project file and uses the Flex3 SDK to compile. To build the project requires the as3-youtube-data-api library Just download youtube-google-0.95.zip and add it to the project path and compile, that is it.

All of the hard work is done by SimpleFeedGrabberExample.as which uses the excellent as3-youtube-data-api library to load feeds from YouTube and parses them into an ArrayCollection which is the Bindable datasource for the display. This is a simple version that will likely change a lot when it is in our Cairngorm project but works fine for now.
as3-youtube-data-api notes: in strict mode you get a few warnings of variables declared without datatypes in the as3-youtube-data-api library but these are easy to fix. Also YouTubeClient has been removed in the library version released yesterday but we substituted YouTubeFeedClient in its place and that seems to work ok.


Once the above is complete to integrate with into the otoh player grab the source code from here:
* copy the src directory into this project src folder
* make YouTubeTest.mxml the target file + make 3 edits to it:
* put xmlns:ytfeeds=”ytfeeds.*” in the Application tag at the top
* put <ytfeeds:YTFeedComponent top=”325″ /> just before </mx:Application>
* insert your YouTube Developer key into YouTubeTest.mxml and compile.

Now when you click on a movie in the display it can be played in the otoh player because video.text is set to the selected movie ID.

Update:
Added a Comments viewer, and a related movies tab using the as3-youtube-data-api

View the updated flex youtube movie here

Category: Code Examples, Flash, YouTube API | 15 Comments