Red5 Data Mapping

— 1 minute read

When sending data to Red5 handlers, it is important to know the counter-part data types used in the server’s Java code.

Red5 Logo
Red5 Logo

There’s is one article mentioning about this at http://jira.red5.org/confluence/display/codecs/Data+Type+Mappings

However, for an unknown reason, the page is not accessible any more. I have to produce a test and observe the conversion of data as following:

From Flash to Red5 (valid to Red5 0.8 / 0.9)

ActionScript 3

Red5

Booleanjava.lang.Boolean
Stringjava.lang.String
uint (< 2147483647)
int (-2147483648 to below 2147483647)
Number (integer value within int range)
java.lang.Integer
uint (>= 2147483647)
Number (integer value out of int range)
java.lang.Long
Number (fraction value)java.lang.Double
Datejava.util.Date
Arrayjava.util.ArrayList
Object / Custom Objectorg.red5.io.utils.ObjectMap
XML, XMLDocumentorg.apache.xerces.dom.DeferredDocumentImpl
(this class seems not to be in Red5’s lib folder)
ByteArrayorg.red5.io.amf3.ByteArray
Special Values: 
NaNNaN

Notes:

  • Negative integer value is limited at –2147483648 even if the variable is declared as Number. If you try to send a value less than this number, it will be rounded up to –2147483648.
  • If one of the params in the remote call is null or undefined, the handler will not be executed.