Download User`s Guide
Transcript
U S E R ’ S
G U I D E
Custom Method Parameters
Parameters passed from the Flash player client to Wowza Media Server Pro need to be marshaled
to Java primitive and object types. The com.wowza.wms.module.ModuleBase class includes a
number of helper functions and constants for converting the parameter values. For more
complex types the com.wowza.wms.amf package contains an API for object conversion. Consult
the server API javadocs and the “Server Side Coding” example for more detailed information.
Below is a simple example of converting three incoming parameters:
package com.mycompany.module;
import
import
import
import
com.wowza.wms.module.*;
com.wowza.wms.client.*;
com.wowza.wms.amf.*;
com.wowza.wms.request.*;
public class MyModule extends ModuleBase
{
public void myFunction(IClient client,
RequestFunction function, AMFDataList params)
{
String param1 = getParamString(params, PARAM1);
int param2 = getParamInt(params, PARAM2);
boolean param3 = getParamBoolean(params, PARAM3);
}
}
Returning Results from a Custom Method
A custom method may return a single result value. This value must be converted to an Action
Message Format (AMF) object to be understood by the Flash player client. These value types can
include simple types like strings, integers and booleans as well as more complex types like objects,
arrays or arrays of objects. The com.wowza.wms.module.ModuleBase class includes a number of
helper functions for returning simple types. For more complex types the com.wowza.wms.amf
package contains an API for object creation and conversion. Consult the server API javadocs
and the “Server Side Coding” example for more detailed information. Below is a simple example
of three methods returning simple value types:
Copyright © 2006 - 2009 Wowza Media Systems, Inc. All rights reserved.
69