Flash Media Server 3.5 announced!

Flash Media Server 3.5 has been announced (Press Release).  I first read this over at Stefan’s site.  After reading his first impression and Kevin Towe’s excellent explanation, I immediately took Kevin’s advice and headed over to the flash.net package where I found some new methods on the NetStream class and a few additional classes dedicated to Streaming.

Interesting indeed.  If your interested in an explanation of the new Features please see Kevin’s link below.

The interesting method inside NetStream is:

play2(param:NetStreamPlayOptions):void

 

play2 () method  

public function play2(param:NetStreamPlayOptions):void

Language Version:  ActionScript 3.0
Runtime Versions:  Flash Player 10, AIR 1.5

Begins playback of media files, with several options for playback.

This method is an enhanced version of NetStream.play() . Like the play() method, the play2() method begins playback of a media file or queues up media files to create a playlist. When used with Flash Media Server, it can also request that the server switch to a different media file. The transition occurs seamlessly in the client application.

Use the play2() method to switch to a stream with the same content encoded at a different bit rate or to swap out streams from a playlist. Use the NetStreamInfo class to monitor network conditions and switch streams based on the data. You can also switch streams for clients with different capabilities. Using ActionScript to switch streams is called dynamic streaming . For more information, search for “dynamic streaming” in the “Adobe Flash Media Server Developer Guide” at www.adobe.com/go/learn_fms_devguide_en . Adobe built a custom ActionScript class called DynamicStream that extends the NetStream class. You can use the DynamicStream class to implement dynamic streaming in an application instead of writing your own code to detect network conditions. Even if you choose to write your own dynamic streaming code, refer to the DynamicStream class to see a working implementation. Download the class and the class documentation at www.adobe.com/go/fms_dynamicstreaming .

More Information according to Kevin Towes:

Original posts:

Red5: 13 RPC Methods you should know

The NetConnection class is native to the Flash Player.  The NetConnection as defined by Adobe does the following:

“The NetConnection class creates a bidirectional connection between a Flash Player or AIR application and a Flash Media Server application or between a Flash Player or AIR application and an application server running Flash Remoting. A NetConnection object is like a pipe between the client and the server. Use NetStream objects to send streams through the pipe.”
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/NetConnection.html

Let’s also get NetStream defined:

“The NetStream class opens a one-way streaming connection between a Flash Player or AIR application and Flash Media Server, or between a Flash Player or AIR application and the local file system. A NetStream object is a channel within a NetConnection object. This channel can either publish a stream, using NetStream.publish(), or subscribe to a published stream and receive data, using NetStream.play(). You can publish or play live (real-time) data and previously recorded data. You can also use NetStream objects to send text messages to all subscribed clients (see the NetStream.send() method).  “
http://livedocs.adobe.com/flex/3/langref/flash/net/NetStream.html

So, we now know that these are two of the essential classes that we deal with when working on communication classes.  Inside of Red5, we have a handler function that reads in amf packets to decide what methods to invoke.  For instance, we can invoke methods that you hang off of your ApplicationAdaptor, or we can invoke internal methods such as the NetStream specific classes.  To be even more accurate, lets say that the NetStream specific classes are inside StreamService.java.   There you will find 13 methods that are essential to streaming/saving/pausing/etc… video and audio streams.

“connect”
“disconnect”
“createStream”
“deleteStream”
“closeStream”
“releaseStream”
“publish”
“pause”
“seek”
“play”
“disconnect”
“receiveVideo”
“receiveAudio”

The problem is that these methods cannot be used on your custom applications since they are associated with the StreamService.  If you do define a method with a signature from above, you will receive an error.  It will either say that the method with those arguments doesn’t exist on StreamService, or that you passed an incorrect argument.  Obviously this doesn’t seem like the optimal way to handle this, but it’s the way it is for now and you should be aware of this.

We are discussing actively whether this should be the implementation or whether we need to go and refactor this behavior.  I am wondering since I haven’t had a chance to test this… does Wowza and FMS behave the same way?  Is it perfectly legal to call rpc methods with these names on those application servers?

Red5: Error connecting to a scope

Connecting to a Red5 application can sometimes prove to be tricky.  Usually it’s something small that is causing the issue though as this one example proves.

On the server, you might receive the following:

[WARN] [DefaultQuartzScheduler_Worker-1] org.red5.server.net.rtmp.RTMPConnection - Closing RTMPMinaConnection from 0:0:0:0:0:0:0:1%0 : 58337 to localhost (in: 3361 out 3273 ), with id 2041793619 due to long handshake

You’re next step is to set a debug breakpoint inside your AS3 NetStatusEvent listener.  There should be an information object named “info”.  Inside the info object there is a String description.  If that description says something like the following, you should try the solution below:

No scope “MyApplication” on this server.     <– replace “MyApplication with your own context name.

Solution:
Check to make sure that you’re web.xml file is pointing to a legitamate java file:

<bean id=”web.handler”
class=”org.red5.core.MyApplication”
singleton=”true” />

If MyApplication doesn’t exist you’ll be presented with the error output above.  Hope this helps someone.

Infrared5 “paper airplane” feature released on our site

http://www.infrared5.com 

It’s interesting to see the Infrared5’s site mature in the past 2 years.  When we started, we had just a simple splash page displaying an email form (original site).  However, we’ve come a long way in terms of functionality and user experience.  Once the user gets by the clean interface driven by page flipping, they quickly see the investment we’ve made.

  • Bio’s complete with friendly photographs
  • Service listings
  • Clients
  • 3d news section
  • 3d blog section with 3d Pen scribbler
  • Info section with:
    • Flash Phone
    • Contact form
    • Rolodex card

and now we’ve added a 3d paper airplane. There isn’t much to it except that it’s pretty fun to play with the site.  We’re continuing to learn new things along the way and to a large degree we owe some respect to Rebecca Allen who has led the way in terms of branding and creativity.  The rest of the IR5 team has made the site possible.  I’ll just list the team that’s worked on the site:

  • Rebecca Allen
  • John Grden
  • Andy Zupko
  • Todd Anderson
  •  Keith Peters
  • Lizzie Martin

I’ll give Chris credit for the content, direction on the site and for Rebecca to bounce ideas off of.  I’ve also put in quite a decent amount of time from the beginning whether it be the original splash page, the serverside components and overall deployment strategy.  It takes a team to pull this stuff off and I’m pretty proud of you guys and gals.

Now, on to the paper airplane.  You just click the “Fly Me” and see what happens.  Just remember that you need to fly all the way to the bottom to get back to the site.  Good luck!  Ah, I also want to point out that there’s a small bug that we’re working on in case you run into it with the debug player ;)

picture-10.png

Here’s a demo of the site or you can just visit it here!

http://www.infrared5.com

Dogs in the office

So, here at Infrared5, Chris, Rebecca and myself bring our dogs to work with us (Trevor and Aniyah).  They are part of the team and in fact they bring quite a lot to the table as you can tell by reading their bio’s from the site!  Of course things don’t always go as planned, but I think for the most part they get along with everyone here ;).  Anyway, Keith who happens to be quite the jokester.  He writes me saying that he’s thinking about getting a dog and that he would like to bring it to work.  I’m not really sure I agree.  Here was his choice.  You decide!

Google Video Chat Service

Google has just released a new video chat service.  I tried it out with Keith and it seems to work great.  They have a proprietary plugin that can encode video to the H.264 format.  From there, I’d imagine they are using some type of server that can deliver H.264 to a flash client in the browser.  They are either using FMS, Red5 or another server similar that can deliver H.264 to the Flash client.  Anyway, it’s a nice addition to their services.

Ribbit acknowledges insane work by Infrared5!

Great job Keith and Todd!  You can read more at the Ribbit blog: http://developer.ribbit.com/blog/?p=121

Do you remember learning HTML?

Just walked into the office today to hear that our sales guy made his first HTML page.  I must admit, I always get excited when someone takes their first steps into internet technologies.  So what if it’s just a simple page with text.  I immediately brought him in and started showing a few tags that he may find interesting.  I remember when I started playing with HTML.  I think everyone says the same thing when they start working with it.  It always goes something like this.. “Oh my god, I’m going to create the best site ever!”  hehehe.  sure enough I remember spending long nights drinking beer working on my masterpiece back in the day.  I also vividly remember being intrigued by romp.com.  I would print their html and just figure it all out…  and like a book, romp had some funny saying at the end inside a comment basically telling the reader that they’ve wasted way too much time reading their shitty html ;).  If anyone’s interested, romp was a histerical flash cartoon site.  Here are some of their episodes from back then: http://www.tsbmag.com/booty-call/.  Anyway, to this day I can spend hours talking to people who get that “aha” moment when they realize just how cool our industry is.  Cheers!

<html>
<head>
<title></title>
</head>
<body>
Hello World!
</body>
</html>

A Duty Not To Vote?

http://townhall.com/Columnists/JohnStossel/2008/10/29/a_duty_not_to_vote?page=full&comments=true

Passing object graphs with custom classes using Red5

I am fighting the itch to say yesterday was a waste of time.  The reason why is with every failure comes a lesson learned.  That's not always true either!  I've learned this lesson many times but it seems that this time there was a slight twist to it.  Debugging twisted issues is much harder than debugging straight forward issues.  Take for instance my previous two posts.  I'll first explain the issues I was running into and the eventual solution to my problem which was something I had dealt with many times over in the past.

I had an application that held a NetConnection to Red5.  The connection was to pass a custom object graph across the wire to the Flash client.  I'll explain in detail what I mean by custom object graph.  For the sake of simplicity I'm referring to a custom Parent class (Listing 1) that holds an ArrayList of  custom Child classes (Listing 2).  Also, you need a service layer method for the client to call.  The third code example is taken from Application.java which is the Red5 entry point (Listing 3).  The fourth code listing shows the clientside connection call to the server which retrieves the custom object graph (Listing 4).

Now the problem is that unless you specifically tell mxmlc to compile in the Custom classes on the client, it won't!  At this point, you will receive an object graph that is just an Object that contains an Array of Objects instead of the intended Parent that has an Array of Child classes.  You can tell the compiler to include classes by including a reference to the class in your code.  This can be done by including the following line somewhere in your code that is already referenced.

Actionscript:
  1. private static var compiledClasses:Array = [ CustomClass ]

A good place to do this is in your top level Application class since we know this is referenced by the compiler.

Once you have the custom classes reference, the runtime will understand how to deserialize your classes into their custom class equivalents.

One other note is that you need to tell the runtime engine which class it should be deserailized into.  You can accomplish this two ways:

  • [RemoteClass(alias="org.red5.core.custom.Child")]
  • registerClassAlias("org.red5.core.custom.Child", this);

The second way may actually be beneficial sine it forces you to send in a reference to the class in the second variable.  Of course if you do this from within the class itself as I have done above, then that would nullify any benefits as there would once again be no reference in the class to any compiled code.
Listing 1:   Parent.java

[Read more →]