Publisher

class Publisher : Client<IPublisher, InterfacePublisherListener>

The Publisher class manages the publication of audio and video tracks to a Millicast stream.

Properties

Link copied to clipboard

Returns the current publisher credentials.

Link copied to clipboard
val currentState: PublisherState

Get the last publisher's state which was emitted

Link copied to clipboard

Returns a boolean indicating whether the client is currently connected to the Millicast platform.

Link copied to clipboard

Checks whether the publisher is currently in a publishing state and returns a boolean indicating the publishing status.

Link copied to clipboard
var onTransformableFrame: (ssrc: Int, timestamp: Int, ArrayList<Byte>) -> Unit?

A callback that allows defining custom transformations or processing logic for video frames before they are transmitted.

Link copied to clipboard
lateinit var recording: Recording

Returns the recording controller for the Publisher instance.

Link copied to clipboard
val rtcStatsReport: SharedFlow<RtsReport>

Flow providing all RTC statistics reports.

Link copied to clipboard
val signalingError: SharedFlow<String>

Flow providing all signaling errors that can be raised.

Link copied to clipboard
val state: SharedFlow<PublisherState>

Flow providing the current subscriber's state.

Functions

Link copied to clipboard
suspend fun addTrack(track: Track)

Adds an audio or video track to the publisher.

Link copied to clipboard
suspend fun connect(connectionOptions: ConnectionOptions? = null)

Initiates a connection to the Millicast platform. By default, the SDK will always attempt to make auto reconnection. To disable this feature, pass a ConnectionOptions instance where autoReconnect is disabled.

Link copied to clipboard

Terminates the current connection to the Millicast platform. Any ongoing process of publishing or subscribing content is automatically stopped before termination. This method returns directly but will perform the call in its queue.

Link copied to clipboard
suspend fun enableFrameTransformer(enable: Boolean)

Enables or disables the frame transformation functionality.

Link copied to clipboard
suspend fun enableStats(enabled: Boolean)

Enables or disables the collection and reporting of real-time statistics associated with streaming sessions.

Link copied to clipboard
suspend fun getMid(trackId: String): String?

Retrieves the Media ID of the corresponding track, providing a unique identifier for the streamed media.

Link copied to clipboard
suspend fun publish(options: Option? = null)

Initiates the process of publishing streams to the streaming platform using specified options. Prior to calling this method, you must use the connect method to connect the publisher to the platform.

Link copied to clipboard
fun release()

Releases any object involved with this instance. For example, object created in the native code which are not garbage collected Do not use this instance after calling release

Link copied to clipboard
suspend fun setCredentials(credentials: Credential)

Sets the credentials, providing authentication information required for connecting to the streaming platform.

Link copied to clipboard
suspend fun unpublish()

Stops the process of publishing streams to the streaming platform. After calling this method, the SDK automatically terminates the connection between the publisher and the streaming platform.