Tuesday, January 16, 2007

Abrupt YouTube security policy change

Due to abrupt youTube 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. You can read more on this on Joe's Blog here.

Woe is me... I think i'll try to port my app to the new BrightCove API that i came across today. Lets wait and watch :)

It seems Flickr did it too... seems like Death of open crossdomain.xmls. Read the post by Renaun Erickson

Monday, January 15, 2007

Card Layout - Draft 1









This is just a draft and its a simple application (with just over 100 lines of code). I finally intent to wrap it into a FLEX Container. So here's my Card Layout

The Card Layout in Java is similar to the View Stack implementation in FLEX. But when i first heard about this layout in awt package, I always expected it to be a container where views animate like flipping cards. It was quite a disappointment. So i decided to write one in FLEX & decided to call it Card Layout.

You can get the code... here

Thursday, December 7, 2006

FLEX - i - FRAME

One of the biggeset pain points of FLEX/Flash (as i see it) is its inability to render HTML in its totality. FLEX supports a few HTML Tags, but not all. Another question that people pose to me is... "When are you guys gonna include PDF rendering in Flash ?".

I hope the answer to that is soon (since its the logical way to go), but here's a (partial) answer to people's woes. I call it "FLEX - i - FRAME". Its an old wine in new bottle, considering the fact that Flash Designers/Developers have been using it since time immemorial.

Thanks to Cristophe, who ported the idea to FLEX1.5 in AS2 (read the post here) and then Brian who gracefully ported the same to AS3 with FLEX 2.0 (read that post here). It has an awesome way of resizing the iFrame when the Flex Application is sized. The great part is, it can make it look like you are rendering HTML and even PDF content inside a Flash/Flex Application.

I took Brian's iFrame MXML component and made a quick application (in about half hour) to show its capabilities. This application will be a one-stop-shop for all resources pertaining to Adobe India's "Adobe Developer Olympiad" RIA Challenge. You can choose from a choice of sites/resources and PDFs from inside this application. So here it is

FLEX - i - FRAME

(To view source, right click on the movie once
you click the above link OR click here)

You can download the whole source code, complete with all dependent files (javascripts, assets.. etc) and use it to playaround with iFrame yourself :)

The trick is very simple. Its just a clever use of the External API interface that lets the Actionscript inside a Flash movie, talk to the Javascript inside the html (in which it is embedded). In this case, the approach is to let the javascript position an IFrame on top of a specific area of your Flex application to provide a container for the HTML content which will then appear embedded in the application.

The IFrame component extends Canvas and is used like any other Flex container. Behind the scenes, it acts as a proxy for the actual HTML IFrame. For example, when the IFrame component is resized or moved it automatically asks the HTML document to resize/move the actual IFrame. You can easily find the ExternalInterface calls in IFrame.mxml and the corresponding JavaScript functions in iFrameDemo.html (renamed to iFrameDemohtml.mxml for reading purposes).

But what kind of surprised me was the amazing perfomance of the History Managemet API. While still within the FLEX Application, you can use the browser back button to navigate to earlier pages... really NEAT !!!

People participating in the ADO RIA Challenge, go ahead and use this innovatively in your application. For more details on ActionScript - JavaScript interaction through External APIs, refer the following links.

Sunday, November 26, 2006

Adobe Developer Olympiad (Win Rs. 50,000)

Adobe India on Friday, announced the Adobe Developer Olympiad. Adobe made its grand entry onto the programming world, with the acqusition of Macromedia... Adding Flash & ColdFusion to its kitty. Now with FLEX2.0 out in the open, Adobe has enough push to reach out to developers and its doing exactly that.

First came the Adobe Developer Derby, which saw some awesome applications being churned out. Check the results and the winning applications here. Then there was an Aussy equivalent of the Derby, which went well too.

So now we have decided to focus on one of the (probably THE) largest developer bases in the world. INDIA !! Our philosophy to start from the grass root level has spun this idea of Adobe Developer Olympiad for Students. The key highlights for the same
  • Any student pursuing a degree in any stream as a full time student of a recognized university in India is eligible to participate in the contest.
  • Submissions can be in 3 categories: Engineering (components), Applications, and ColdFusion integration.
  • Each category has a prize of Rs. 50,000
  • You can participate individually or as a team of upto 5 members
Check out these following links to start off....
More updates will follow... Any queries, mail to the Developer Olympiad Mailing list (ado@adobe .com)

try.flex.org

This looks awesome... A Flex Online Compiler where you can type your code and compile it online and see the results along with it.. Ideal for beginners to start off with Flex. Check it out

http://try.flex.org/

The Flex Online Compiler is powered by Flex, ColdFusion, and Spry

Saturday, July 8, 2006

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.


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

I'm Addicted to You Tube & its API

You Tube is a fantastic site... It has captivated my imagination for sometime now, that I was glued to it. A novel idea of uploading videos and then making it freely "searchable" or blog-appendable for anyone. You can see a whole lot of You Tube videos in my Media Blog... But one thing about youtube I did not like was its searchability and the ease of use to find a video that you are looking for (by user, by tag...etc).

So, I have been wanting to write a search tool for youTube for a long time now. And then i chanced on the youTube API. Its a set of very simple REST (click here to know about REST) calls that would return me useful search info like search by tags, username... etc in a simple, ready to use XML Format!!

I could now use this data in my Flex Application & write a search tool... So I was well on my way to write a youTube Search tool... That in the next post..

Before i sign off, here's a video I found on youTube that defines my state of affairs with youTube in the past few days.


I'm addicted To youTube