AIR Video Player With Growl Notifications

When I saw Mike Chambers tweet post I knew I had to have a play. I love Growl and I am game for a play around with what Mike has done. The first thing I wanted to do was integrate it into a PureMVC streaming video player and tinker from there.

I built a super super simple streaming video player in Flex and as it was a quick throw up thought that I would like the handling of all the Growl notifications to occur in a Proxy.

  • GrowlProxy: I define as Mike clearly shows an Application instance and Notification Type.
  • GrowlCommand: Handles all growl notifications sent on a PureMVC notification (hmmm naming!). I use the PureMVC notification system to send notes to the facade using a named constant ApplicationFacade.GROWL_ALERT.
  • This constant is registered to a command who’s sole purpose is to create a new Growl notification using the params from the PureMVC notification params ( note.getBody(), note.GetType() ) and then calls the GrowlProxy sendGrowl() method.
  • This is nice as now anywhere in the application to display a growl notification all I have to do is:
sendNotification( ApplicationFacade.GROWL_ALERT, "Growl Text", "Growl Title" );

So the video test app I built will show growl notifications on NetConnection, NetStream status, etc. Not necessarily what you want in a video app maybe but for a demo I thought it would do just fine.

I did as Mike advised and built a Growl release using X Tools and have attached this in the source files below. I cannot take any responsibility to the outcome of using this build of Growl, all I have done is follow Mikes instructions and it works a treat for me. If your concerned in any way build a release using his instructions here.

I have attached the AIR file I built for you to test out as you please, it will play one video streamed using FlashMediaServer and features…wait for it…. a pause play button!!!!

  • NOTE * Install the Growl.prefPane first and then NewtriksGrowlVideo.air