com.wowza.wms.client
Interface IClient


public interface IClient

IClient: public interface to Client object.


Field Summary
static String AUDIOSAMPLE_ACCESS_ALL
           
static String AUDIOSAMPLE_ACCESS_NONE
           
static String READ_ACCESS_ALL
           
static String READ_ACCESS_NONE
           
static String VIDEOSAMPLE_ACCESS_ALL
           
static String VIDEOSAMPLE_ACCESS_NONE
           
static String WRITE_ACCESS_ALL
           
static String WRITE_ACCESS_NONE
           
 
Method Summary
 void acceptConnection()
          Accept connection
 void acceptConnection(AMFData successObj)
          Accept connection
 void acceptConnection(String successStr)
          Accept connection
 void addAcceptConnectionAttribute(String key, AMFDataObj item)
          Add and attribute to the resultObj that gets passed back to the client on successful connection
 void addAcceptConnectionAttribute(String key, String item)
          Add and attribute to the resultObj that gets passed back to the client on successful connection
 void call(String handlerName)
          Simplified call client method/handler call.
 void call(String handlerName, IModuleCallResult resultObj, Object... params)
          Call client method/handler.
 void clearFastPlaySettings()
          Force clear the fastPlay settings
 void fcSubscribe(String streamName)
          Subscribe to a live stream (for live stream repeater to start start from edge to origin)
 void fcSubscribe(String streamName, String mediaCasterType)
          Subscribe to a live stream (use a particular mediaCasterType)
 void fcUnSubscribe(String streamName)
          UnSubscribe from a stream
 void fcUnSubscribeAll()
          UnSubscribe to all streams that this client is current subscribed to
 IApplicationInstance getAppInstance()
          Get parent applicationInstance.
 IApplication getApplication()
          Get parent application.
 int getBufferTime()
          Get default buffer time for newly created mediaStream objects
 int getClientId()
          Get client id.
 long getConnectTime()
          Get time in milliseconds the client connected to the server.
 String getDateStarted()
          Get date and time of client connection
 ElapsedTimer getElapsedTime()
          Get elapsed time client has been connected.
 FastPlaySettings getFastPlaySettings()
          Get the current fastPlay settings.
 String getFlashVer()
          Get client flash version (same as FMS getAgent())
 int getIdleFrequency()
          Get client idle frequency (milliseconds)
 String getIp()
          Client ip address
 long getLastValidateTime()
          Get last time (millisecond) the connection was validated with a ping
 int getLiveRepeaterCapabilities()
          Get the live repeater capabilities of this connection
 String getLiveStreamPacketizerList()
          Get the comma separated list of LiveStreamPacketizers names being used by this client (see conf/LiveStreamPacketizers.xml)
 int getMaximumPendingWriteBytes()
          Get maximum number a bytes a client connection can have waiting to be sent before the connection is terminated.
 int getMaximumSetBufferTime()
          Get maximum number of milliseconds allowed for the NetStream.setBufferTime(secs) call.
 IOPerformanceCounter getMediaIOPerformanceCounter()
          Get performance counter for media bytes transferred to this client.
 int getObjectEncoding()
          Get the object encoding level
 String getPageUrl()
          Get the pageUrl for this connection.
 long getPingRoundTripTime()
          Get turn around time (milliseconds) of last ping request
 int getPingTimeout()
          Get the ping timeout (milliseconds)
 java.util.List getPlayStreams()
          Get a collection of all play streams.
 WMSProperties getProperties()
          Get client properties
 int getProtocol()
          Get connection protocol (1 = RTMP, 3 = RTMPT)
 java.util.List getPublishStreams()
          Get a collection of publish streams.
 String getQueryStr()
          Get the query string part of the connection string.
 String getReferrer()
          Get the referrer data for this connection.
 String getRepeaterOriginUrl()
          Get the origin URL used by the Live Stream Repeater
 AMFObj getRespAMFAudioObj(IMediaStream stream)
          Get the audio response AMFObj for a given mediaStream
 AMFObj getRespAMFDataObj(IMediaStream stream)
          Get the data response AMFObj for a given mediaStream
 AMFObj getRespAMFVideoObj(IMediaStream stream)
          Get the video response AMFObj for a given mediaStream
 ResponseFunctions getRespFunctions()
          Get client responseFunctions object.
 AMFObj getResponseAMFObj(int index)
          Get the response channel AMFObj for channel index.
 RTPStream getRTPStream()
          If this client was created due to an RTP connection to the server return the underlying RTPStream object
 HostPort getServerHostPort()
          Get the hostPort object for the connection that is servicing this client
 String getSharedObjectReadAccess()
          Get the shared object read access value.
 String getSharedObjectWriteAccess()
          Get the shared object write access value.
 String getStreamAudioSampleAccess()
          Get the audio sample access value.
 java.io.File getStreamFile(String streamName)
          Get File object for stream with given name.
 java.io.File getStreamFile(String streamName, String streamExt)
          Get File object for stream with given name and extension.
 java.io.File getStreamFile(String streamName, String streamExt, boolean doCreateFolder)
          Get File object for stream with given name and extension.
 String getStreamReadAccess()
          Get the stream read access value.
 String getStreamType()
          Get default streamType
 String getStreamVideoSampleAccess()
          Get the video sample access value.
 String getStreamWriteAccess()
          Get the stream write access value.
 String getTimeRunning()
          Get elapsed time of connection
 double getTimeRunningSeconds()
          Get time running in seconds
 IOPerformanceCounter getTotalIOPerformanceCounter()
          Get performance counter for all bytes transferred to this client.
 String getUri()
          Get the full URI of the connection string
 IVHost getVHost()
          Get parent vHost
 com.wowza.wms.client.ClientWriteListener getWriteListener()
          Object that tracks write operations
 boolean isAcceptConnection()
          Is auto accept connection
 boolean isConnected()
          Is this client connected
 boolean isEncrypted()
          Is this connection encrypted (RTMPE or RTMPTE)
 boolean isFlashMediaLiveEncoder()
          Returns true if this connection is the Flash Media Live Encoder
 boolean isFlashVersion10()
          Returns true if the Flash version is equal or greater than 10.x.x.x
 boolean isFlashVersion90115()
          Returns true if the Flash version is equal or greater than 9.0.115.x
 boolean isFlashVersionH264Capable()
          Returns true if the connected client is capable of playing H.264 video (Flash player 9.0.45.x or greater)
 boolean isLiveRepeater()
          Returns true if this connection is from the live stream repeater
 boolean isObjectEncodingAMF0()
          Is the object encoding for this client AMF0
 boolean isObjectEncodingAMF3()
          Is the object encoding for this client AMF3
 boolean isSecure()
          Is this connection protected by either SSL or encryption (RTMPE, RTMPTE, RTMPS)
 boolean isSSL()
          Is this connection SSL (RTMPS)
 boolean isValidateFMLEConnections()
          Returns true if validating FMLE connection (default is false)
 int ping(IModulePingResult pingResult)
          Ping client.
 void redirectConnection(String url)
          Redirection connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected and info.ex.code of 302)
 void redirectConnection(String url, String description)
          Redirection connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected and info.ex.code of 302)
 void redirectConnection(String url, String description, AMFData errorObj)
          Redirection connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected and info.ex.code of 302).
 void redirectConnection(String url, String description, String errorStr)
          Redirection connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected and info.ex.code of 302)
 void rejectConnection()
          Reject connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected)
 void rejectConnection(AMFData errorObj)
          Reject connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected)
 void rejectConnection(String errorStr)
          Reject connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected)
 void rejectConnection(String description, AMFData errorObj)
          Reject connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected)
 void rejectConnection(String description, String errorStr)
          Reject connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected)
 void reparentClient(IVHost vhost)
          Move a client object to a new vhost.
 void setAcceptConnection(boolean acceptConnection)
          Set the default for accept connection
 void setAcceptConnectionDescription(String description)
          Call this method from onConnect to set the info.description property returned in NetConnection onStatus handler
 void setAcceptConnectionExObj(AMFDataObj acceptConnectionExObj)
          Call this method from onConnect to set the info.ex property returned in NetConnection onStatus handler
 void setAcceptConnectionObj(AMFData acceptConnectionObj)
          Call this method from onConnect to add an "application" property to the info object that is passed back to the Flash client in the onStatus handler.
 void setBufferTime(int bufferTime)
          Set default buffer time for newly created mediaStream objects
 void setFastPlaySettings(FastPlaySettings fastPlaySettings)
          Set fastPlay settings
 void setFlashVer(String flashVer)
          Set client flash version
 void setIdleFrequency(int idleFrequency)
          Set client idle frequency (milliseconds)
 void setLastValidateTime(long lastValidateTime)
          Set the last time (milliseconds) the connection was validated with ping
 void setLiveRepeaterCapabilities(int liveRepeaterCapabilities)
          Set the live repeater capabilities of this connection
 void setLiveStreamPacketizerList(String liveStreamPacketizerList)
          Set the comma separated list of LiveStreamPacketizers names being used by this client (see conf/LiveStreamPacketizers.xml)
 void setObjectEncoding(int objectEncoding)
          Set the object encoding level
 void setRepeaterOriginUrl(String repeaterOriginUrl)
          Set the origin URL used by the Live Stream Repeater
 void setSharedObjectReadAccess(String sharedObjectReadAccess)
          Set the shared object read access value.
 void setSharedObjectWriteAccess(String sharedObjectWriteAccess)
          Set the shared object write access value.
 void setShutdownClient(boolean shutdownClient)
          Gracefully and forecefully shutdown a client.
 void setStreamAudioSampleAccess(String audioSampleAccess)
          Set the stream audio sample access value.
 void setStreamReadAccess(String streamReadAccess)
          Set the stream object read access value.
 void setStreamType(String streamType)
          Set default streamType
 void setStreamVideoSampleAccess(String videoSampleAccess)
          Set the stream video sample access value.
 void setStreamWriteAccess(String streamWriteAccess)
          Set the stream object write access value.
 void setValidateFMLEConnections(boolean validateFMLEConnections)
          Returns true if validating FMLE connection (default is false)
 void shutdownClient()
          Gracefully shutdown a client.
 int testFlashVersion(int[] version)
          Test to see if the connected client flash version is equal to or greater than a given value.
 void touch()
          Update the last touch time for client
 

Field Detail

AUDIOSAMPLE_ACCESS_ALL

static final String AUDIOSAMPLE_ACCESS_ALL
See Also:
Constant Field Values

AUDIOSAMPLE_ACCESS_NONE

static final String AUDIOSAMPLE_ACCESS_NONE
See Also:
Constant Field Values

READ_ACCESS_ALL

static final String READ_ACCESS_ALL
See Also:
Constant Field Values

READ_ACCESS_NONE

static final String READ_ACCESS_NONE
See Also:
Constant Field Values

VIDEOSAMPLE_ACCESS_ALL

static final String VIDEOSAMPLE_ACCESS_ALL
See Also:
Constant Field Values

VIDEOSAMPLE_ACCESS_NONE

static final String VIDEOSAMPLE_ACCESS_NONE
See Also:
Constant Field Values

WRITE_ACCESS_ALL

static final String WRITE_ACCESS_ALL
See Also:
Constant Field Values

WRITE_ACCESS_NONE

static final String WRITE_ACCESS_NONE
See Also:
Constant Field Values
Method Detail

acceptConnection

void acceptConnection()
Accept connection


acceptConnection

void acceptConnection(AMFData successObj)
Accept connection

Parameters:
successObj - application property value added to NetConnection.Connect.Success event object

acceptConnection

void acceptConnection(String successStr)
Accept connection

Parameters:
successStr - application property value added to NetConnection.Connect.Success event object

addAcceptConnectionAttribute

void addAcceptConnectionAttribute(String key,
                                  AMFDataObj item)
Add and attribute to the resultObj that gets passed back to the client on successful connection

Parameters:
key - key
item - item to add

addAcceptConnectionAttribute

void addAcceptConnectionAttribute(String key,
                                  String item)
Add and attribute to the resultObj that gets passed back to the client on successful connection

Parameters:
key - key
item - item to add

call

void call(String handlerName)
Simplified call client method/handler call. No resultObj. No parameters

Parameters:
handlerName - handler name

call

void call(String handlerName,
          IModuleCallResult resultObj,
          Object... params)
Call client method/handler. You can call any method/handler attached to NetConnection object. Such as netConnection.myFunc

Call Client Handler Method With Result Object

IClient client;

class ReturnObj implements IModuleCallResult
{
        public void onResult(IClient client, RequestFunction function, 
                AMFDataList params)
        {
                WMSLoggerFactory.getLogger(null).debug("onResult");
        }
}

client.call("onCustomMethod", new ReturnObj(), "param1", 1.2345, false, new Date());

Parameters:
handlerName - handler name
resultObj - if client method returns data this object will receive callback, null if don't care or no return on client method/handler.
params - variable list of argument. Will be automatically wrapped in AMFData objects

clearFastPlaySettings

void clearFastPlaySettings()
Force clear the fastPlay settings


fcSubscribe

void fcSubscribe(String streamName)
Subscribe to a live stream (for live stream repeater to start start from edge to origin)

Parameters:
streamName - stream name

fcSubscribe

void fcSubscribe(String streamName,
                 String mediaCasterType)
Subscribe to a live stream (use a particular mediaCasterType)

Parameters:
streamName - stream name
mediaCasterType - media caster type name

fcUnSubscribe

void fcUnSubscribe(String streamName)
UnSubscribe from a stream

Parameters:
streamName - stream name

fcUnSubscribeAll

void fcUnSubscribeAll()
UnSubscribe to all streams that this client is current subscribed to


getAppInstance

IApplicationInstance getAppInstance()
Get parent applicationInstance. Is null if connection reject or before accepted.

Returns:
parent applicationInstance

getApplication

IApplication getApplication()
Get parent application. Is null if connection reject or before accepted.

Returns:
application

getBufferTime

int getBufferTime()
Get default buffer time for newly created mediaStream objects

Returns:
default buffer time (millseconds)

getClientId

int getClientId()
Get client id. Assigned by server and connection time.

Returns:
client id

getConnectTime

long getConnectTime()
Get time in milliseconds the client connected to the server. To get the duration of time in milliseconds that the client has been connected to the server us the following formula: (System.currentTimeMillis() - client.getConnectTime())

Returns:
duration connected (millseconds)

getDateStarted

String getDateStarted()
Get date and time of client connection

Returns:
date and time of connection

getElapsedTime

ElapsedTimer getElapsedTime()
Get elapsed time client has been connected.

Returns:
elapsed time client has been connected.

getFastPlaySettings

FastPlaySettings getFastPlaySettings()
Get the current fastPlay settings. FastPlay settings when set from the client are immediatly cleared on the next call to seek/unpause/play.

Returns:
fastPlay settings

getFlashVer

String getFlashVer()
Get client flash version (same as FMS getAgent())

Returns:
client flash version string

getIdleFrequency

int getIdleFrequency()
Get client idle frequency (milliseconds)

Returns:
client idle frequency (milliseconds)

getIp

String getIp()
Client ip address

Returns:
client ip address

getLastValidateTime

long getLastValidateTime()
Get last time (millisecond) the connection was validated with a ping

Returns:
last time (millisecond) the connection was validated with a ping

getLiveRepeaterCapabilities

int getLiveRepeaterCapabilities()
Get the live repeater capabilities of this connection

Returns:
live repeater capabilities of this connection

getLiveStreamPacketizerList

String getLiveStreamPacketizerList()
Get the comma separated list of LiveStreamPacketizers names being used by this client (see conf/LiveStreamPacketizers.xml)

Returns:
comma separated list of LiveStreamPacketizers names

getMaximumPendingWriteBytes

int getMaximumPendingWriteBytes()
Get maximum number a bytes a client connection can have waiting to be sent before the connection is terminated. If set to zero this feature is turned off.

Returns:
maximum number a bytes a client connection can have waiting to be sent before the connection is terminated

getMaximumSetBufferTime

int getMaximumSetBufferTime()
Get maximum number of milliseconds allowed for the NetStream.setBufferTime(secs) call. If set to zero this feature is turned off.

Returns:
maximum number of milliseconds allowed for the NetStream.setBufferTime(secs) call

getMediaIOPerformanceCounter

IOPerformanceCounter getMediaIOPerformanceCounter()
Get performance counter for media bytes transferred to this client. Only includes bytes to mediaStream objects

Returns:
performance counter

getObjectEncoding

int getObjectEncoding()
Get the object encoding level

Returns:
object encoding level

getPageUrl

String getPageUrl()
Get the pageUrl for this connection.

Returns:
pageUrl for this connection

getPingRoundTripTime

long getPingRoundTripTime()
Get turn around time (milliseconds) of last ping request

Returns:
time (milliseconds)

getPingTimeout

int getPingTimeout()
Get the ping timeout (milliseconds)

Returns:
ping timeout (milliseconds)

getPlayStreams

java.util.List getPlayStreams()
Get a collection of all play streams. Play streams are streams that are created due to a call to play.

Iterate Play Streams

IClient client;

List playStreams = client.getPlayStreams();
Iterator iter = playStreams.iterator();
while(iter.hasNext())
{
        IMediaStream stream = (IMediaStream)iter.next();
        WMSLoggerFactory.getLogger(null).debug("stream: "+stream.getName());
}

Returns:
collection of play streams

getProperties

WMSProperties getProperties()
Get client properties

Returns:
collection of client properties

getProtocol

int getProtocol()
Get connection protocol (1 = RTMP, 3 = RTMPT)

Returns:
connection protocol (1 = RTMP, 3 = RTMPT)

getPublishStreams

java.util.List getPublishStreams()
Get a collection of publish streams. Publish streams are streams that are created due to a call to publish.

Iterate Public Streams

IClient client;

List publishStreams = client.getPublishStreams();
Iterator iter = publishStreams.iterator();
while(iter.hasNext())
{
        IMediaStream stream = (IMediaStream)iter.next();
        WMSLoggerFactory.getLogger(null).debug("stream: "+stream.getName());
}

Returns:
collection of publish stream

getQueryStr

String getQueryStr()
Get the query string part of the connection string. If the connection string where: rtmp://localhost/app/appInst?data1=myData1&data2=myData2, then query string would be data1=myData1&data2=myData2

Returns:
query string

getReferrer

String getReferrer()
Get the referrer data for this connection. The referrer in Wowza Media Server terms is the full url to the Flash movie that connected to the server. Checking referre upon connection is a great way to secure server connections and only allow your Flash movies to connect to the server.

Only Allow Your .swf Files to Connect to Wowza Pro server


public class MyModule extends ModuleBase
{
        static public void onConnect(IClient client, RequestFunction function, 
                AMFDataList params)
        {
                String referrer = client.getReferrer();

                if (referrer.indexOf("www.mycompany.com") >= 0 && 
                                referrer.indexOf("mycoolflash.swf") >= 0)
                        client.acceptConnection("valid referrer");
                else
                        client.rejectConnection("invalid referrer: "+referrer);
        }
}

Returns:
referrer

getRepeaterOriginUrl

String getRepeaterOriginUrl()
Get the origin URL used by the Live Stream Repeater

Returns:
URL used by the Live Stream Repeater

getRespAMFAudioObj

AMFObj getRespAMFAudioObj(IMediaStream stream)
Get the audio response AMFObj for a given mediaStream

Parameters:
stream - mediaStream
Returns:
response channel AMFObj

getRespAMFDataObj

AMFObj getRespAMFDataObj(IMediaStream stream)
Get the data response AMFObj for a given mediaStream

Parameters:
stream - mediaStream
Returns:
response channel AMFObj

getRespAMFVideoObj

AMFObj getRespAMFVideoObj(IMediaStream stream)
Get the video response AMFObj for a given mediaStream

Parameters:
stream - mediaStream
Returns:
response channel AMFObj

getRespFunctions

ResponseFunctions getRespFunctions()
Get client responseFunctions object. The responseFunctions object is the method by which events are sent to the client. This code snippet shows how to send an onStatus event for a mediaStream (stream) to the client.

Send Status Message to Client


ResponseFunctions respFunctions = client.getRespFunctions();

ResponseFunction resp = new ResponseFunction();
resp.createDefaultMessage("onStatus", 0.0);
resp.setRetAMFObj(stream.getRespAMFDataObj());
resp.setSrc(stream.getSrc());

AMFDataObj data = new AMFDataObj();
data.put("level", new AMFDataItem("status"));
data.put("code", new AMFDataItem("NetStream.Publish.Success"));
data.put("description", new AMFDataItem(stream.getName()+" is now unpublished."));
data.put("clientid", new AMFDataItem(clientID));
resp.addBody(data);

respFunctions.add(resp);

Returns:
responseFunctions object

getResponseAMFObj

AMFObj getResponseAMFObj(int index)
Get the response channel AMFObj for channel index.

Parameters:
index - channel index
Returns:
AMFObj

getRTPStream

RTPStream getRTPStream()
If this client was created due to an RTP connection to the server return the underlying RTPStream object

Returns:
underlying RTPStream object

getServerHostPort

HostPort getServerHostPort()
Get the hostPort object for the connection that is servicing this client

Returns:
vHost hostPort servicing request

getSharedObjectReadAccess

String getSharedObjectReadAccess()
Get the shared object read access value. see setSharedObjectReadAccess for more information.

Returns:
shared object read access value

getSharedObjectWriteAccess

String getSharedObjectWriteAccess()
Get the shared object write access value. see setSharedObjectWriteAccess for more information.

Returns:
shared object write access value

getStreamAudioSampleAccess

String getStreamAudioSampleAccess()
Get the audio sample access value. see setVideoStreamAccess for more information.

Returns:
audio sample access

getStreamFile

java.io.File getStreamFile(String streamName)
Get File object for stream with given name. Assumes file extension is .flv.

Parameters:
streamName - stream name
Returns:
file

getStreamFile

java.io.File getStreamFile(String streamName,
                           String streamExt)
Get File object for stream with given name and extension. For example test.flv would be getStreamFile("test", "flv");

Get File Descriptor


IClient client;
File file = client.getStreamFile("test", "flv");
WMSLogger log = WMSLoggerFactory.getLogger(null);
if (file != null)
{
        if (file.exists())
                log.debug("getStreamFile: "+ file.getPath());
}

Parameters:
streamName - stream name
streamExt - stream extension
Returns:
file

getStreamFile

java.io.File getStreamFile(String streamName,
                           String streamExt,
                           boolean doCreateFolder)
Get File object for stream with given name and extension. If doCreateFolder is true, create folder necessary to make path exist. For example test.flv would be getStreamFile("test", "flv");

Parameters:
streamName - stream name
streamExt - stream extension
doCreateFolder - create folders if needed
Returns:
file

getStreamReadAccess

String getStreamReadAccess()
Get the stream read access value. see setStreamReadAccess for more information.

Returns:
stream read access value

getStreamType

String getStreamType()
Get default streamType

Returns:
streamType

getStreamVideoSampleAccess

String getStreamVideoSampleAccess()
Get the video sample access value. see setVideoStreamAccess for more information.

Returns:
video sample access

getStreamWriteAccess

String getStreamWriteAccess()
Get the stream write access value. see setStreamWriteAccess for more information.

Returns:
stream write access value

getTimeRunning

String getTimeRunning()
Get elapsed time of connection

Returns:
elapsed time of connection

getTimeRunningSeconds

double getTimeRunningSeconds()
Get time running in seconds

Returns:
time running in seconds

getTotalIOPerformanceCounter

IOPerformanceCounter getTotalIOPerformanceCounter()
Get performance counter for all bytes transferred to this client. This includes function calls.

Returns:
performance counter

getUri

String getUri()
Get the full URI of the connection string

Returns:
URI of connection string

getVHost

IVHost getVHost()
Get parent vHost

Returns:
vHost object

getWriteListener

com.wowza.wms.client.ClientWriteListener getWriteListener()
Object that tracks write operations

Returns:
Object that tracks write operations

isAcceptConnection

boolean isAcceptConnection()
Is auto accept connection

Returns:
auto accept connection

isConnected

boolean isConnected()
Is this client connected

Returns:
is connected

isEncrypted

boolean isEncrypted()
Is this connection encrypted (RTMPE or RTMPTE)

Returns:
is connection encrypted (RTMPE or RTMPTE)

isFlashMediaLiveEncoder

boolean isFlashMediaLiveEncoder()
Returns true if this connection is the Flash Media Live Encoder

Returns:
true if this connection is the Flash Media Live Encoder

isFlashVersion10

boolean isFlashVersion10()
Returns true if the Flash version is equal or greater than 10.x.x.x

Returns:
returns true if the Flash version is equal or greater than 10.x.x.x

isFlashVersion90115

boolean isFlashVersion90115()
Returns true if the Flash version is equal or greater than 9.0.115.x

Returns:
returns true if the Flash version is equal or greater than 9.0.115.x

isFlashVersionH264Capable

boolean isFlashVersionH264Capable()
Returns true if the connected client is capable of playing H.264 video (Flash player 9.0.45.x or greater)

Returns:
returns true if the connected client is capable of playing H.264 video (Flash player 9.0.45.x or greater)

isLiveRepeater

boolean isLiveRepeater()
Returns true if this connection is from the live stream repeater

Returns:
true if this connection is from the live stream repeater

isObjectEncodingAMF0

boolean isObjectEncodingAMF0()
Is the object encoding for this client AMF0

Returns:
true of the object encoding for this client is AMF0

isObjectEncodingAMF3

boolean isObjectEncodingAMF3()
Is the object encoding for this client AMF3

Returns:
true of the object encoding for this client is AMF3

isSecure

boolean isSecure()
Is this connection protected by either SSL or encryption (RTMPE, RTMPTE, RTMPS)

Returns:
is connection protected by either SSL or encryption (RTMPE, RTMPTE, RTMPS)

isSSL

boolean isSSL()
Is this connection SSL (RTMPS)

Returns:
is connection (RTMPS)

isValidateFMLEConnections

boolean isValidateFMLEConnections()
Returns true if validating FMLE connection (default is false)

Returns:
true if validating FMLE connection

ping

int ping(IModulePingResult pingResult)
Ping client. Unlike FMS this ping is asynchronous. pingResult object will be notified of successful response by client or timeout.

Ping Client and Kill Connection If Client Has Died

class PingResult implements IModulePingResult
{
        public void onResult(IClient client, long pingTime, int pingId, boolean result)
        {
                WMSLogger log = WMSLoggerFactory.getLogger(null);
                log.debug("onResult: result:"+result);
                if (!result)
                {
                        // client has died lets kill it
                        client.getAppInstance().shutdownClient(client);
                }
                else
                        log.debug("lastPingTime: "+client.getPingRoundTripTime());
        }
}
client.ping(new PingResult());

Parameters:
pingResult - ping result object. Will receive callback on result of ping or timeout. Can be null.
Returns:
ping id

redirectConnection

void redirectConnection(String url)
Redirection connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected and info.ex.code of 302)

Parameters:
url - url (returned in onStatus handler in info.ex.redirect parameter)

redirectConnection

void redirectConnection(String url,
                        String description)
Redirection connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected and info.ex.code of 302)

Parameters:
url - url (returned in onStatus handler in info.ex.redirect parameter)
description - description (returned in onStatus handler in info.description parameter)

redirectConnection

void redirectConnection(String url,
                        String description,
                        AMFData errorObj)
Redirection connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected and info.ex.code of 302). Code must be added client side to capture the NetConnection.Connect.Rejected message, look for the info.ex.code value of 302 and attempt a reconnect to the info.ex.redirect url. Client side example:
public function ncOnStatus(infoObject:NetStatusEvent)
{
        if (infoObject.info.code == "NetConnection.Connect.Rejected")
        {
                if (infoObject.info.ex.code == 302)
                {
                        trace("Connection redirected: "+infoObject.info.ex.redirect);
                        nc.connect(infoObject.info.ex.redirect);
                }
                else
                        trace("Connection rejected");
        }
}
nc.addEventListener(NetStatusEvent.NET_STATUS, ncOnStatus);

Parameters:
url - url (returned in onStatus handler in info.ex.redirect parameter)
description - description (returned in onStatus handler in info.description parameter)
errorObj - error AMFData (returned in onStatus handler in info.application parameter)

redirectConnection

void redirectConnection(String url,
                        String description,
                        String errorStr)
Redirection connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected and info.ex.code of 302)

Parameters:
url - url (returned in onStatus handler in info.ex.redirect parameter)
description - description (returned in onStatus handler in info.description parameter)
errorStr - error (returned in onStatus handler in info.application parameter)

rejectConnection

void rejectConnection()
Reject connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected)


rejectConnection

void rejectConnection(AMFData errorObj)
Reject connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected)

Parameters:
errorObj - error AMFData (returned in onStatus handler in info.application parameter)

rejectConnection

void rejectConnection(String errorStr)
Reject connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected)

Parameters:
errorStr - error (returned in onStatus handler in info.application parameter)

rejectConnection

void rejectConnection(String description,
                      AMFData errorObj)
Reject connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected)

Parameters:
description - description (returned in onStatus handler in info.description parameter)
errorObj - error AMFData (returned in onStatus handler in info.application parameter)

rejectConnection

void rejectConnection(String description,
                      String errorStr)
Reject connection (NetConnection.onStatus handler returns info.code of NetConnection.Connect.Rejected)

Parameters:
description - description (returned in onStatus handler in info.description parameter)
errorStr - error (returned in onStatus handler in info.application parameter)

reparentClient

void reparentClient(IVHost vhost)
Move a client object to a new vhost. This can only be done right after the handshake process has completed. See IVHostNotify.onVHostClientConnect.

Parameters:
vhost - new vhost

setAcceptConnection

void setAcceptConnection(boolean acceptConnection)
Set the default for accept connection

Parameters:
acceptConnection - default for accept connection

setAcceptConnectionDescription

void setAcceptConnectionDescription(String description)
Call this method from onConnect to set the info.description property returned in NetConnection onStatus handler

Parameters:
description - description

setAcceptConnectionExObj

void setAcceptConnectionExObj(AMFDataObj acceptConnectionExObj)
Call this method from onConnect to set the info.ex property returned in NetConnection onStatus handler

Parameters:
acceptConnectionExObj - exObj AMFData item return in info.ex propert of NetConnection onStatus handler

setAcceptConnectionObj

void setAcceptConnectionObj(AMFData acceptConnectionObj)
Call this method from onConnect to add an "application" property to the info object that is passed back to the Flash client in the onStatus handler.

Parameters:
acceptConnectionObj - connection object

setBufferTime

void setBufferTime(int bufferTime)
Set default buffer time for newly created mediaStream objects

Parameters:
bufferTime - bufer time (milliseconds)

setFastPlaySettings

void setFastPlaySettings(FastPlaySettings fastPlaySettings)
Set fastPlay settings

Parameters:
fastPlaySettings - fastPlay settings

setFlashVer

void setFlashVer(String flashVer)
Set client flash version

Parameters:
flashVer - client flash version string

setIdleFrequency

void setIdleFrequency(int idleFrequency)
Set client idle frequency (milliseconds)

Parameters:
idleFrequency - client idle frequency (milliseconds)

setLastValidateTime

void setLastValidateTime(long lastValidateTime)
Set the last time (milliseconds) the connection was validated with ping

Parameters:
lastValidateTime - last time (milliseconds) the connection was validated with ping

setLiveRepeaterCapabilities

void setLiveRepeaterCapabilities(int liveRepeaterCapabilities)
Set the live repeater capabilities of this connection

Parameters:
liveRepeaterCapabilities - live repeater capabilities of this connection

setLiveStreamPacketizerList

void setLiveStreamPacketizerList(String liveStreamPacketizerList)
Set the comma separated list of LiveStreamPacketizers names being used by this client (see conf/LiveStreamPacketizers.xml)

Parameters:
liveStreamPacketizerList - comma separated list of LiveStreamPacketizers names

setObjectEncoding

void setObjectEncoding(int objectEncoding)
Set the object encoding level

Parameters:
objectEncoding - object encoding level

setRepeaterOriginUrl

void setRepeaterOriginUrl(String repeaterOriginUrl)
Set the origin URL used by the Live Stream Repeater

Parameters:
repeaterOriginUrl - URL used by the Live Stream Repeater

setSharedObjectReadAccess

void setSharedObjectReadAccess(String sharedObjectReadAccess)
Set the shared object read access value. This list is a semi-colon delimeted list of shared objects that this client has access to. By default the value is set to IClient.READ_ACCESS_ALL which indicates this client can read all shared objects. If you want to disable read access to all shared objects set this value to IClient.READ_ACCESS_NONE. If this value is set to anything other than IClient.READ_ACCESS_ALL or IClient.READ_ACCESS_NONE then each item in the semi-color delimited list is compared against incoming shared object read requests. If any item in the list completely matches the shared object name or the start of the shared object name, then access is allowed. For example, if the sharedObjectReadAccess list is set to "testa/testb;testc" then the following requests would be granted the following access: Values in this list are always case sensitive.

Parameters:
sharedObjectReadAccess - shared object read access value

setSharedObjectWriteAccess

void setSharedObjectWriteAccess(String sharedObjectWriteAccess)
Set the shared object write access value. This list is a semi-colon delimeted list of shared objects that this client has access to. By default the value is set to IClient.WRITE_ACCESS_ALL which indicates this client can write all shared objects. If you want to disable write access to all shared objects set this value to IClient.WRITE_ACCESS_NONE. If this value is set to anything other than IClient.WRITE_ACCESS_ALL or IClient.WRITE_ACCESS_NONE then each item in the semi-color delimited list is compared against incoming shared object write requests. If any item in the list completely matches the shared object name or the start of the shared object name, then access is allowed. For example, if the sharedObjectWriteAccess list is set to "testa/testb;testc" then the following requests would be granted the following access: Values in this list are always case sensitive.

Parameters:
sharedObjectWriteAccess -

setShutdownClient

void setShutdownClient(boolean shutdownClient)
Gracefully and forecefully shutdown a client.

Parameters:
shutdownClient - set to true to gracefully and forecefully shutdown a client

setStreamAudioSampleAccess

void setStreamAudioSampleAccess(String audioSampleAccess)
Set the stream audio sample access value. This list is a semi-colon delimeted list of stream names that this client has access to. By default the value is set to IClient.AUDIOSTREAM_ACCESS_NONE which indicates this client can access no stream data client side. If you want to enable access to all stream names set this value to IClient.AUDIOSTREAM_ACCESS_ALL. If this value is set to anything other than IClient.AUDIOSTREAM_ACCESS_ALL or IClient.AUDIOSTREAM_ACCESS_NONE then each item in the semi-color delimited list is compared against incoming stream play requests. If any item in the list completely matches the stream name or the start of the stream name, then access is allowed. For example, if the streamAudioSampleAccess list is set to "testa/testb;testc" then the following play requests would be granted the following access: Values in this list are always case sensitive.

Parameters:
audioSampleAccess -

setStreamReadAccess

void setStreamReadAccess(String streamReadAccess)
Set the stream object read access value. This list is a semi-colon delimeted list of stream names that this client has access to. By default the value is set to IClient.READ_ACCESS_ALL which indicates this client can play all streams. If you want to disable read access to all stream names set this value to IClient.READ_ACCESS_NONE. If this value is set to anything other than IClient.READ_ACCESS_ALL or IClient.READ_ACCESS_NONE then each item in the semi-color delimited list is compared against incoming stream play requests. If any item in the list completely matches the stream name or the start of the stream name, then access is allowed. For example, if the streamReadAccess list is set to "testa/testb;testc" then the following play requests would be granted the following access: Values in this list are always case sensitive.

Parameters:
streamReadAccess - shared object read access value

setStreamType

void setStreamType(String streamType)
Set default streamType

Parameters:
streamType - streamType

setStreamVideoSampleAccess

void setStreamVideoSampleAccess(String videoSampleAccess)
Set the stream video sample access value. This list is a semi-colon delimeted list of stream names that this client has access to. By default the value is set to IClient.VIDEOSTREAM_ACCESS_NONE which indicates this client can access no stream data client side. If you want to enable access to all stream names set this value to IClient.VIDEOSTREAM_ACCESS_ALL. If this value is set to anything other than IClient.VIDEOSTREAM_ACCESS_ALL or IClient.VIDEOSTREAM_ACCESS_NONE then each item in the semi-color delimited list is compared against incoming stream play requests. If any item in the list completely matches the stream name or the start of the stream name, then access is allowed. For example, if the streamVideoSampleAccess list is set to "testa/testb;testc" then the following play requests would be granted the following access: Values in this list are always case sensitive.

Parameters:
videoSampleAccess -

setStreamWriteAccess

void setStreamWriteAccess(String streamWriteAccess)
Set the stream object write access value. This list is a semi-colon delimeted list of stream names that this client has access to. By default the value is set to IClient.WRITE_ACCESS_ALL which indicates this client can play all streams. If you want to disable write access to all stream names set this value to IClient.WRITE_ACCESS_NONE. If this value is set to anything other than IClient.WRITE_ACCESS_ALL or IClient.WRITE_ACCESS_NONE then each item in the semi-color delimited list is compared against incoming stream play requests. If any item in the list completely matches the stream name or the start of the stream name, then access is allowed. For example, if the streamWriteAccess list is set to "testa/testb;testc" then the following play requests would be granted the following access: Values in this list are always case sensitive.

Parameters:
streamWriteAccess - shared object read access value

setValidateFMLEConnections

void setValidateFMLEConnections(boolean validateFMLEConnections)
Returns true if validating FMLE connection (default is false)

Parameters:
validateFMLEConnections - true if validating FMLE connection

shutdownClient

void shutdownClient()
Gracefully shutdown a client. Only use this method to shutdown a client if you know the client is connected to Wowza Pro. If the client may be disconnected from Wowza Pro, use IClient.setShutdownClient(true)


testFlashVersion

int testFlashVersion(int[] version)
Test to see if the connected client flash version is equal to or greater than a given value. Example: int isGood = testFlashVersion( { 9, 0, 5, 12} );

Parameters:
version - array of version values
Returns:
1 if greater, 0 if equal, -1 if less then

touch

void touch()
Update the last touch time for client