Extended FileReference in Flash Player 10 is good but…

… it`s still not quite what I dreamed of. Out of enthusiasm about the new great features I blindly tried to convert RichFLV to a browser only version.
In theory everything is there to build such powerfull browser applications now but the problem is that it seems that there is no way to get the actual filepath to the selected file just the data. I can absolutely understand this because it might be another security concern but this means that you cannot display most of the data a user selects.
For a simple image uploader this might be fine because you can easily create an image from the ByteArray with Actionscript but for example for videos or sounds this is not the case. Yeah I know you can always create a swf in memory and then pass it to a Loader instance but that`s not really cool. So if I would want to create something like RichFLV in the browser there is no way to display the video directly on the client :-(

So please Adobe open up the NetStream Object so we can work directly with bytes on it.
Please vote for this feature here https://bugs.adobe.com/jira/browse/FP-5

I think access to the bytes of a NetStream object would also allow acces to the webcam stream and microphone right? This would be so important and open up thousands of possibilites. And it would be a perfect workaround for the security filepath problem. If we are able to actually do something with the data why would we need the filepath πŸ˜‰

Just had to get this out before the feature list for FP10 is closed and we I have to wait for another 2 years :-)

How AIR should NOT be used

Just checked out the Shu player. It`s an application that packages your AIR application as a standalone application and extends it`s functionality a bit.
This might sound intriguing first but it really only shows how people are not getting the advatages of AIR. Why is this a bad solution?

  • standalone means the AIR runtime is packaged into your app which bloats the installation size. This is one main advatage of AIR. You install the runtime once and then all the AIR apps are small in size
  • You`ll loose the smooth seamless installation functionality of AIR apps
  • What about autoupdate?
  • What if the runtime updates?

In the end this is nothing more then the good old projector tools and I think if you want something like this there is nothing better than Zinc 3.0.

That said I kind of understand the motivation behind this tool. On the first glance it adds some of the most missing features to AIR mainly being able to run native programs.
But as it at the same time destroys the real power of AIR this is a no go for me. Keeping thumbs crossed that AIR 2.0 soves this by adding those features.

The game is on: Parleys to switch from Flex to JavaFX to GWT to Flex to JavaFX to GWT to JavaFX…

… to Flex (had to make sure it ends on Flex ;-)) We`ll see who`ll win the game. This is actually a really cool use case. Stephan Janssen my current client is actually crazy enough to let develop three versions (if you count the current Ajax version it`s 4) of his famous parleys website. I`m currently developing the Flex and AIR version of it and I`m certainly biased as to which version i`ll prefer but from a technology point this is a really cool approach. I mean everyone is telling us that their technology is the best. Sun with JavaFX (mhhh), Google with GWT (mhhh) Adobe with Flex (yeah baby!) and now taking away all biased opinions we`ll actually be able to judge about the result rather some marketing material. We`ll see the exact same app build on top of those three technologies. I must admit that sometimes I have a hard time when my client pings me saying that there is a new feature in the JavaFX version that really rocks. But at the same time it motivates me to make the Flex version even better. I`m right in the war! And at the same time it`s also for me a great opportunity to compare those different approaches. But for all you Adobe people out there be warned you might be in the pole position now but others are catching up – well i believe it will stay like this for a looooong time πŸ˜‰

The moment JavaFX and GWT are at the level of Flex/AIR Adobe will also have made some steps – that`s what I`m counting on and I hope that challenges like these will also motivate them to push even harder (also I think they are curretly doing agreat job at this :-))

We`re not quite ready to judge about the different versions yet as all of them are not ready. Currently you can see these versions:

– old Ajax version which http://www.parleys.com

– Flex beta client (http://www.parleys.com/display/V21Beta/Home#page=Home)

– Flex AIR client (you can get it through the Flex client or download here )

I`ll post my views about this here as the development continues and make sure to post things that are only possible with one or the other technology as for me this is the most interesting part.
I`ll just start with some hints for Adobe what i think might become a downer for the Flex/AIR version :-)
http://bugs.adobe.com/jira/browse/SDK-14245 (vote,vote,vote!!!)
– allow the socket class to listen on ports to allow p2p functionality!!!
– Allow access of bytes from NetStream and Sound Objects
– Screensharing for at least all Media Server users

These are all things where maybe the JavaFX version will have advatages but mhhh maybe when they finally (if ever) finish JavaFX we`ll have this in Flex too πŸ˜‰

Hey Adobe,Sun,Google this is not a game it`s a war let`s flood us developers with features :-)

Some interesting thoughts about this here.

Doing partial/resumable uploads with AIR

This post by Ryan Stewart motivated me for a little example with sockets in AIR. I wanted a way to upload files to a server with the possibility to interrupt uploads at any time and pick them up later.
So to do this I thought it would be cool if it works like streaming video to the client but just the other way around. I developed a mini protocol to do this. It works like this:

1. Client (AIR app) establishes a socket connection to Server (Java based in my case)

2. If connection is succesful client send a request which looks like this: 1 byte = operation type 1, length of the body, filename to upload as UTF bytes

3. Server checks if the file with the given filename already exists if so it responds with 1byte = operation type 1, a long (64bit) value which is the size of the file on the server or 0 if it does not yet exist.
4. Client send a package from the file starting at the size of the file on the server: operation type = 2 (1byte), length of body = length of the package, bytes of the package

and so on and so on… You get the idea.

With this mechanism the upload can be interupted and picked up any time. The client and the server always know what`s happening and were the bytes belomg to.

Warning! This is a very very over symplified, incomplete example. No real error handling, no handling for multiple clients, security?…
It`s just a prove of concept. I`m not a java developer and only hacked this together very quickly. The source is really ugly and normally I would not post something like this but as I always promise to clean up everything and post later (and rarely do ;-)) i just post them here so you can get the idea and build something sophisticated out of it.

Here is a screencast that shows the app in action.

Get the sources (again really dirty sources only use for inspiration)

Don`t even think about buying Flex Builder standard edition!

I was just working on some performance improvements for parleys while I encountered a big memory leak.
If you run into problems like these (and you will sooner or later :-)) Flex Builder professional saves your day. The profiler alone is worth every extra penny.
Not only should you take care to use weak references with listeners but also watch for your Bindings. If you use the Binding tag their is no way to remove the reference and therefore your objects will never be ready for garbage collection. So i get used to replace my binding tags to ChangeWatchers which gives me the ability to unwatch them. Β  With the profiler it`s really easy to find and fix performance and memory issues like these. I was able to reduce the memory usage by 2/3 in 30 min of work.
These otpimisations are not yet in the current parleys beta version (will be next week) – so watch out for the difference :-)

So please do yourself a favor and don`t be stingy – get yourself the full monty and buy Flex Builder Pro!
Espacially if you`re a dirty hacker like me Flex BuilderPro will help you improve your skills πŸ˜‰

Stitch Flv files with RichFLV

In my last post about the RichFLV AIR 1.0 update I forgot to mention the biggest new feature :-)
You can now stitch together flv files! It`s not really implemented in the most comfortable way and the feature is not really tested but for most cases it should work.
In the file menu you`ll have a new option Import > FLV (stitch). This will import a new flv to the flv currently in RichFLV and stitch them together.
Check out this screencast to see how it works.

Again this is not deeply tested so be carefull and let me know if you run into problems. Some of my observations are:

– different fps might give audio sync problems

– different resolutions work!

– different codecs work

Let me know what results you get. This is a feature i will implement in RichFLV NextGen in a much better way so your feedback here will really help me make this cool.



Get RichFLV for AIR 1.0Β  + See the new feature in action

[kml_flashembed movie=”http://www.richapps.de/files/richflv/installbage/badge.swf” height=”180″ width=”217″ fvars=”appname=RichFLV&appurl=http://www.richapps.de/files/richflv/installbadge/richflv.air&airversion=1.0.M6&buttoncolor=FF0000&messagecolor=000000&imageurl=http://www.richapps.de/files/richflv/installbadge/richflv.jpg” /]

Visual search with AIR and Papervision

I just did a little experiment with AIR and Papervision. This app grabs all the overview thumbs from Parleys.com, saves them together with the corresponding tags in a local database and lets you search through them. It also generates checkboxes for each tag so you can filter them. The search result is visualized with papervision. ItΒ΄s really fun to type and see all the items fly around and rearrange.
I only have a screencast here for now but I plan to release a simpler version with source soon. I used Ying to record this screencast so the fps is a bit low but believe me it`s super smooth in reality.

Check out the screencast

What I learned from this experiment?
– AIR rocks!
– AIR Sqlite support roocks!
– Papervision rooocks!
– Flash Player performance roooocks!


Joining the AIR “Train” tour

Finally the Adobe AIR tour is coming to europe and not only that it`s also coming to my hometown Berlin!
This is really cool because Berlin is really lacking Adobe events. It`s really strange that all the cool Adobe events in Germany have been in boring cities like Munich which compared to Berlin is a village πŸ˜‰
I have the pleasure to join the AIR team on this tour in Berlin (4 June) and Warsaw (6 June). Go register here


RichFLV ready for AIR 1.0

Just updated RichFLV for Air 1.0 and introduced some minor feature updates.

1. Edit Metadata:
This was requested for a long time. You can now edit the onMetaData. For now you can simply add or delete custom key/value pairs.


2. Set In- and Outpoints on Keyframes:
You can now set the In and outpoints directly on keyframes. Select a keyframe in the keyframe tab and click on the Set Inpoint/Set Outpoint buttons.


[kml_flashembed movie=”http://www.richapps.de/files/richflv/installbage/badge.swf” height=”180″ width=”217″ fvars=”appname=RichFLV&appurl=http://www.richapps.de/files/richflv/installbadge/richflv.air&airversion=1.0.M6&buttoncolor=FF0000&messagecolor=000000&imageurl=http://www.richapps.de/files/richflv/installbadge/richflv.jpg” /]

It`s a bit strange working on this “old” version while already working on
version 2 which is completely different but this may take a while. In the meantime you can check out this video to see what`s coming.

Kevin Lynch shows Parleys – running on linux

Today at the engage conference Kevin Lynch showed a version of Parleys running on linux :-)
This is really crazy! Imagine this – I have developed this application but as I`m not a linux guyI never saw it on linux.
Now i see it running on linux without any efford done by me- really cool. If that does not show the power of AIR.

As a site note it`s really flattering for me to see one of my heros demoing one of the apps i build. I feel like Eddie Vedder is performing a song I wrote πŸ˜‰
You can see a video of his presentation here: http://qik.com/video/26353 (parleys is at about 2:50)