18 December 2009

Red5 Data Mapping

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

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

Boolean java.lang.Boolean
String java.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
Date java.util.Date
Array java.util.ArrayList
Object / Custom Object org.red5.io.utils.ObjectMap
XML, XMLDocument org.apache.xerces.dom.DeferredDocumentImpl
(this class seems not to be in Red5’s lib folder)
ByteArray org.red5.io.amf3.ByteArray
Special Values:  
NaN NaN

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.

1 comment:

  1. Tình cờ mình vào blog này của bạn & đọc được bài này. Mình nghĩ nếu những bài viết thế này được copy vào hoặc link đến từ wiki của red5 thì tốt :D

    ReplyDelete