Package org.red5.client.net.rtmpe
Class RTMPEClient
- java.lang.Object
-
- org.red5.server.net.rtmp.BaseRTMPHandler
-
- org.red5.client.net.rtmp.BaseRTMPClientHandler
-
- org.red5.client.net.rtmp.RTMPClient
-
- org.red5.client.net.rtmpe.RTMPEClient
-
- All Implemented Interfaces:
ClientExceptionHandler,INetStreamEventHandler,IRTMPClient,org.red5.server.api.event.IEventDispatcher,org.red5.server.messaging.IConsumer,org.red5.server.messaging.IMessageComponent,org.red5.server.messaging.IPipeConnectionListener,org.red5.server.messaging.IPushableConsumer,org.red5.server.net.rtmp.IRTMPHandler,org.red5.server.net.rtmp.message.Constants,org.red5.server.net.rtmp.status.StatusCodes
public class RTMPEClient extends RTMPClient implements INetStreamEventHandler, ClientExceptionHandler, org.red5.server.api.event.IEventDispatcher, org.red5.server.messaging.IPushableConsumer, org.red5.server.messaging.IPipeConnectionListener
RTMPE client object based on the original RTMP client.- Author:
- Paul Gregoire, Gavriloaie Eugen-Andrei
-
-
Field Summary
-
Fields inherited from class org.red5.client.net.rtmp.RTMPClient
CONNECTOR_WORKER_TIMEOUT, future, ioHandler, session, socketConnector
-
Fields inherited from class org.red5.client.net.rtmp.BaseRTMPClientHandler
bandwidthCheckDone, conn, connectionParams, executor, protocol, subscribed
-
Fields inherited from interface org.red5.server.net.rtmp.message.Constants
HANDSHAKE_SIZE, HEADER_CONTINUE, HEADER_NEW, HEADER_SAME_SOURCE, HEADER_TIMER_CHANGE, MEDIUM_INT_MAX, SO_CLIENT_CLEAR_DATA, SO_CLIENT_DELETE_DATA, SO_CLIENT_INITIAL_DATA, SO_CLIENT_SEND_MESSAGE, SO_CLIENT_STATUS, SO_CLIENT_UPDATE_ATTRIBUTE, SO_CLIENT_UPDATE_DATA, SO_CONNECT, SO_DELETE_ATTRIBUTE, SO_DISCONNECT, SO_SEND_MESSAGE, SO_SET_ATTRIBUTE, SOURCE_TYPE_LIVE, SOURCE_TYPE_VOD, TYPE_ABORT, TYPE_AGGREGATE, TYPE_AUDIO_DATA, TYPE_BYTES_READ, TYPE_CHUNK_SIZE, TYPE_CLIENT_BANDWIDTH, TYPE_EDGE_ORIGIN, TYPE_FLEX_MESSAGE, TYPE_FLEX_SHARED_OBJECT, TYPE_FLEX_STREAM_SEND, TYPE_INVOKE, TYPE_NOTIFY, TYPE_PING, TYPE_SERVER_BANDWIDTH, TYPE_SHARED_OBJECT, TYPE_STREAM_METADATA, TYPE_VIDEO_DATA
-
Fields inherited from interface org.red5.server.net.rtmp.status.StatusCodes
APP_GC, APP_RESOURCE_LOWMEMORY, APP_SCRIPT_ERROR, APP_SCRIPT_WARNING, APP_SHUTDOWN, NC_CALL_BADVERSION, NC_CALL_FAILED, NC_CONNECT_APPSHUTDOWN, NC_CONNECT_CLOSED, NC_CONNECT_FAILED, NC_CONNECT_INVALID_APPLICATION, NC_CONNECT_REJECTED, NC_CONNECT_SUCCESS, NS_BUFFER_EMPTY, NS_CLEAR_FAILED, NS_CLEAR_SUCCESS, NS_DATA_START, NS_FAILED, NS_INVALID_ARGUMENT, NS_PAUSE_NOTIFY, NS_PLAY_COMPLETE, NS_PLAY_FAILED, NS_PLAY_FILE_STRUCTURE_INVALID, NS_PLAY_INSUFFICIENT_BW, NS_PLAY_NO_SUPPORTED_TRACK_FOUND, NS_PLAY_PUBLISHNOTIFY, NS_PLAY_RESET, NS_PLAY_START, NS_PLAY_STOP, NS_PLAY_STREAMNOTFOUND, NS_PLAY_SWITCH, NS_PLAY_TRANSITION, NS_PLAY_TRANSITION_COMPLETE, NS_PLAY_UNPUBLISHNOTIFY, NS_PUBLISH_BADNAME, NS_PUBLISH_START, NS_RECORD_FAILED, NS_RECORD_NOACCESS, NS_RECORD_START, NS_RECORD_STOP, NS_SEEK_FAILED, NS_SEEK_NOTIFY, NS_TRANSITION_FORCED, NS_TRANSITION_SUCCESS, NS_UNPAUSE_NOTIFY, NS_UNPUBLISHED_SUCCESS, SO_CREATION_FAILED, SO_NO_READ_ACCESS, SO_NO_WRITE_ACCESS, SO_PERSISTENCE_MISMATCH
-
-
Constructor Summary
Constructors Constructor Description RTMPEClient()Constructs a new RTMPEClient
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClientListener(IClientListener clientListener)Adds a listener for receiving rtmp events.static ProxycreateProxy(RTMPEClient client, String host, int port, String app)Creates a proxy.static WritercreateWriter(RTMPEClient client)Creates a writer.voiddisconnect()Disconnect the first connection in the connection mapvoiddispatchEvent(org.red5.server.api.event.IEvent event)StringgetFileName()Returns the filename if vod is being used.StringgetStreamName()Returns the name of the stream being utilized.voidhandleException(Throwable throwable)Handle any exceptions that occur.voidonMetaData(Object object)Callback method fired when a MetadataEvent is detected.voidonOOBControlMessage(org.red5.server.messaging.IMessageComponent source, org.red5.server.messaging.IPipe pipe, org.red5.server.messaging.OOBControlMessage oobCtrlMsg)voidonPipeConnectionEvent(org.red5.server.messaging.PipeConnectionEvent event)voidonStatus(Object status)Callback method fired when a NetStatusEvent is detected.voidonStreamEvent(org.red5.server.net.rtmp.event.Notify notify)Callback method fired when a Notify or other stream event is detected.voidpushMessage(org.red5.server.messaging.IPipe pipe, org.red5.server.messaging.IMessage message)voidsetFileName(String fileName)Sets the filename for vod.voidsetStreamName(String streamName)Sets the name of the stream being utilized.-
Methods inherited from class org.red5.client.net.rtmp.RTMPClient
makeDefaultConnectionParams, setProtocol, startConnector
-
Methods inherited from class org.red5.client.net.rtmp.BaseRTMPClientHandler
connect, connect, connect, connect, connect, connectionClosed, connectionOpened, createStream, deleteStream, getChannelForStreamId, getConnection, getConnectionParams, getSharedObject, invoke, invoke, isBandwidthCheckDone, isSubscribed, isSwfVerification, onBWCheck, onBWCheck, onBWDone, onBWDone, onChunkSize, onClientBandwidth, onCommand, onPing, onServerBandwidth, onSharedObject, ping, play, play2, publish, publishStreamData, releaseStream, setConnection, setConnectionClosedHandler, setExceptionHandler, setServiceProvider, setStreamEventDispatcher, setStreamEventHandler, setSwfVerification, subscribe, unpublish
-
-
-
-
Method Detail
-
disconnect
public void disconnect()
Disconnect the first connection in the connection map- Specified by:
disconnectin interfaceIRTMPClient- Overrides:
disconnectin classRTMPClient
-
handleException
public void handleException(Throwable throwable)
Description copied from class:BaseRTMPClientHandlerHandle any exceptions that occur.- Specified by:
handleExceptionin interfaceClientExceptionHandler- Overrides:
handleExceptionin classBaseRTMPClientHandler- Parameters:
throwable- Exception thrown
-
addClientListener
public void addClientListener(IClientListener clientListener)
Adds a listener for receiving rtmp events.- Parameters:
clientListener-
-
getStreamName
public String getStreamName()
Returns the name of the stream being utilized.- Returns:
- the streamName
-
setStreamName
public void setStreamName(String streamName)
Sets the name of the stream being utilized.- Parameters:
streamName- the streamName to set
-
getFileName
public String getFileName()
Returns the filename if vod is being used.- Returns:
- the fileName
-
setFileName
public void setFileName(String fileName)
Sets the filename for vod.- Parameters:
fileName- the fileName to set
-
onOOBControlMessage
public void onOOBControlMessage(org.red5.server.messaging.IMessageComponent source, org.red5.server.messaging.IPipe pipe, org.red5.server.messaging.OOBControlMessage oobCtrlMsg)- Specified by:
onOOBControlMessagein interfaceorg.red5.server.messaging.IMessageComponent
-
onPipeConnectionEvent
public void onPipeConnectionEvent(org.red5.server.messaging.PipeConnectionEvent event)
- Specified by:
onPipeConnectionEventin interfaceorg.red5.server.messaging.IPipeConnectionListener
-
pushMessage
public void pushMessage(org.red5.server.messaging.IPipe pipe, org.red5.server.messaging.IMessage message) throws IOException- Specified by:
pushMessagein interfaceorg.red5.server.messaging.IPushableConsumer- Throws:
IOException
-
dispatchEvent
public void dispatchEvent(org.red5.server.api.event.IEvent event)
- Specified by:
dispatchEventin interfaceorg.red5.server.api.event.IEventDispatcher
-
onStatus
public void onStatus(Object status)
Callback method fired when a NetStatusEvent is detected. {@link http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/NetStatusEvent.html}- Parameters:
status-
-
onStreamEvent
public void onStreamEvent(org.red5.server.net.rtmp.event.Notify notify)
Callback method fired when a Notify or other stream event is detected.- Specified by:
onStreamEventin interfaceINetStreamEventHandler- Parameters:
notify-
-
onMetaData
public void onMetaData(Object object)
Callback method fired when a MetadataEvent is detected. {@link http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/events/MetadataEvent.html} {@link http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/VideoDisplay.html#metadata}- Parameters:
object- metadata from a stream.
-
createProxy
public static Proxy createProxy(RTMPEClient client, String host, int port, String app)
Creates a proxy.- Parameters:
client-host- destination hostport- destination portapp- destination application- Returns:
- proxy
-
createWriter
public static Writer createWriter(RTMPEClient client)
Creates a writer.- Parameters:
client-- Returns:
- writer
-
-