RtmpConnection

Manages a two-way RTMP or RTMPS connection to a server application.

connect starts an asynchronous connection attempt. Listen for Event.RTMP_STATUS and Event.IO_ERROR to observe the result. A connection can own multiple RtmpStream instances.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard

RTMP connection status codes included in status event data.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The outgoing RTMP chunk size, in bytes.

Link copied to clipboard

The client version string sent as flashVer in the RTMP connect command.

Link copied to clipboard

Elapsed time in milliseconds from queuing C0/C1 to receiving the full S2 packet. This includes local queuing and server processing time. It is null until the handshake completes and is reset when the next connection attempt starts.

Link copied to clipboard

Whether the RTMP handshake has completed and the connection has not been closed.

Link copied to clipboard

The referring page URL sent in the RTMP connect command.

Link copied to clipboard

The SWF URL sent in the RTMP connect command, if required by the server.

Link copied to clipboard

The timeout setting forwarded to the active transport.

Link copied to clipboard

The total number of bytes received by the underlying socket.

Link copied to clipboard

The total number of bytes sent by the underlying socket.

Link copied to clipboard
var uri: URI?

The URI most recently passed to connect, or null before the first connection attempt.

Functions

Link copied to clipboard
open override fun addEventListener(type: String, listener: IEventListener, useCapture: Boolean)

Registers a listener for an event name and capture flag.

open fun addEventListener(type: String, listener: IEventListener)

Registers a listener with capture disabled.

Link copied to clipboard
fun call(commandName: String, responder: Responder?, vararg arguments: Any)

Invokes a command on the server. Does nothing if the connection is not connected.

Link copied to clipboard
fun close()

Closes all streams owned by this connection and disconnects from the server.

Link copied to clipboard
fun connect(command: String, vararg arguments: Any?)

Starts connecting to an RTMP server application.

Link copied to clipboard
open override fun dispatchEvent(event: Event)

Delivers an event to the matching listeners.

Link copied to clipboard
open override fun dispatchEventWith(type: String, bubbles: Boolean, data: Any?)

Creates and dispatches an event with the given name, bubbling flag, and payload.

open fun dispatchEventWith(type: String)

Creates and dispatches a non-bubbling event without a payload.

open fun dispatchEventWith(type: String, bubbles: Boolean)

Creates and dispatches an event without a payload.

Link copied to clipboard
fun dispose()

Cancels statistics callbacks and releases the resources of all owned streams.

Link copied to clipboard
open override fun removeEventListener(type: String, listener: IEventListener, useCapture: Boolean)

Unregisters a listener using the event name and capture flag supplied during registration.

open fun removeEventListener(type: String, listener: IEventListener)

Unregisters a listener registered with capture disabled.