RtmpStream

class RtmpStream(context: Context, connection: RtmpConnection, playbackDynamicRangeMode: DynamicRangeMode) : Stream, IEventDispatcher

Publishes or plays a one-way media stream over an RtmpConnection.

For publishing, register this stream as an output of a media mixer. For playback, register an output view on this stream. Listen for Event.RTMP_STATUS to observe stream status changes.

Parameters

context

The Android context used for codecs and rendering.

connection

The connection that owns this stream.

Constructors

Link copied to clipboard
constructor(context: Context, connection: RtmpConnection, playbackDynamicRangeMode: DynamicRangeMode)
constructor(context: Context, connection: RtmpConnection)

Creates the default SDR pipeline.

Types

Link copied to clipboard

RTMP stream status codes included in status event data.

Link copied to clipboard
object Companion
Link copied to clipboard

The server-side publishing mode sent with the publish command.

Link copied to clipboard
data class Info(var resourceName: String? = null)

Information about the publishing resource.

Link copied to clipboard
interface Listener

Receives periodic stream statistics callbacks.

Properties

Link copied to clipboard
Link copied to clipboard

The number of video frames counted during the most recent statistics interval.

Link copied to clipboard
Link copied to clipboard

Specifies the stream name used for FMLE-compatible sequences.

Link copied to clipboard
open override var hasAudio: Boolean
Link copied to clipboard
open override var hasVideo: Boolean
Link copied to clipboard

Information about this stream's publishing resource.

Link copied to clipboard

The statistics listener, or null to disable callbacks.

Link copied to clipboard
Link copied to clipboard

Whether to request audio during playback. Changes are sent to the server while playing.

Link copied to clipboard

Whether to request video during playback. Changes are sent to the server while playing.

Link copied to clipboard
open override val screen: Screen
Link copied to clipboard

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
open override fun append(buffer: MediaBuffer)
Link copied to clipboard
open override fun close()

Deletes the server stream and stops local media processing. Leaves the connection open.

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
open override fun dispose()

Removes the connection listener, stops media processing, and releases local stream resources.

Link copied to clipboard
fun play(vararg arguments: Any)

Requests playback of a server stream or recording.

Link copied to clipboard
fun publish(name: String?, howToPublish: RtmpStream.HowToPublish = HowToPublish.LIVE)

Requests publishing to the server. The request is queued until the server stream is created.

Link copied to clipboard
fun queueOutputBuffer(type: MediaType, index: Int, payload: ByteBuffer?, timestamp: Long, sync: Boolean)
Link copied to clipboard
open override fun registerOutput(output: MediaOutput)
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.

Link copied to clipboard
fun send(handlerName: String, vararg arguments: Any)

Sends an RTMP data message on this stream.

Link copied to clipboard
open override fun unregisterOutput(output: MediaOutput)