youTube Search, powered by Flex

Jan 2007: Due to abrupt youTube.com security policy change, my youTube App doesnt work anymore. Possibly due to an exploit, youTube abruptly changed their crossdomain.xml file to only allow access from the youtube.com domain. As a result, YouTube developer API calls no longer work if the SWF exists in a non-youtube.com domain

So here it is, I have finally done it… a day of hard work, coupled with a couple of days of research :). I have the youTube search Tool, ready to go! You might have to de-activate the popUp blocker on your browser to see this application. I have made an alternate version for those who do not know how to do that. This application requires you to have FlashPlayer9. Download FlashPlayer 9 here and then Click on the links below.

Click here for youTube Search
(Click here for the alternate version)

This is the first public application that I am posting, so I’m really excited about it. It was an awsome experience building this application. The initial time was spent in the layout, look & feel of the app (which i think is still “too plain”). Then came the REST calls and parsing the incoming XML to suit my needs.

Then came a heart-breaker for me, which made me almost ditch my application. Due to some chaps ripping flvs (Flash Videos) off youTube (read it here), youTube had reworked their site inorder not to expose the flvs. So now i couldn’t play them in my app… Directly.

But a programmer always finds workarounds to problems. Those who frequent youtube know that youtube provides a html code snippet, allowing you to embed it into your blog. In the code, there is a text like “tLuLE3jm1VU” is the only thing that varies across videos (and its called the video id). I had the video id of the videos i wanted, thanks to the youTube API. So i wrote a small PHP script to take the id as input and then generate the html page for my video.

I would then popUp this window as an html page (of a specified size) through JavaScript which was called inturn from my application using the Flash External Interface API. And hola… it worked… But my woes wouldnt end there. This workaround came at the cost of perfomance in my app and some of the thumbnails were not loading properly after the external interface call.

Then our very own Manish came to the rescue… Manish had written a youTube Featured video player back in March and had now reworked it to extract the flv out of the id again… Then things were all on a platter for me… I could now use Manish’s code snippets, extract the flv file and play it in my own Video Display inside FLEX.

A bit of exceptional handling and try-catching 🙂 and the application was ready to rock. So presenting to you….

If you find any bugs or issues, mail it to me at raghunath.rao at gmail dot com
Anyone wants to look at the code, you can find it here…

Advertisements

3 Responses to youTube Search, powered by Flex

  1. Romeo Khan says:

    can you update the application because there is a updates conserning crossdomain..

  2. abhishek says:

    how can we show movies from Youtube or Google video in FLEX using RSS feeds,
    how can we read RSS feeds

  3. Abhishek that would be a nice thing. RSS Feeds from you tube movies.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s