BaseScreenRecorderLiveStreamer

open class BaseScreenRecorderLiveStreamer(context: Context, enableAudio: Boolean = true, muxer: IMuxer, endpoint: ILiveEndpoint, initialOnErrorListener: OnErrorListener? = null, initialOnConnectionListener: OnConnectionListener? = null) : BaseScreenRecorderStreamer, ILiveStreamer

A BaseScreenRecorderStreamer that sends microphone and screen frames to a remote device.

Parameters

context

application context

enableAudio

Boolean.true to capture audio. False to disable audio capture.

muxer

a IMuxer implementation

endpoint

a ILiveEndpoint implementation

initialOnErrorListener

initialize OnErrorListener

initialOnConnectionListener

Constructors

Link copied to clipboard
constructor(context: Context, enableAudio: Boolean = true, muxer: IMuxer, endpoint: ILiveEndpoint, initialOnErrorListener: OnErrorListener? = null, initialOnConnectionListener: OnConnectionListener? = null)

Properties

Link copied to clipboard

Set/get activity result from ComponentActivity.registerForActivityResult callback. It is mandatory to set this before startStream.

Link copied to clipboard

Access configuration helper.

Link copied to clipboard
open override val isConnected: Boolean

Check if the streamer is connected to the server.

Link copied to clipboard

Listener to manage connection.

Link copied to clipboard
open override var onErrorListener: OnErrorListener?

Listener that reports streamer error. Supports only one listener.

Link copied to clipboard
open override val settings: BaseStreamerSettings

Access extended streamer settings.

Functions

Link copied to clipboard
@RequiresPermission(value = "android.permission.RECORD_AUDIO")
open override fun configure(audioConfig: AudioConfig)

Configures audio settings. It is the first method to call after a BaseStreamer instantiation. It must be call when both stream and audio capture are not running.

open override fun configure(videoConfig: VideoConfig)

Configures video settings. It is the first method to call after a BaseStreamer instantiation. It must be call when both stream and video capture are not running.

@RequiresPermission(value = "android.permission.RECORD_AUDIO")
open override fun configure(audioConfig: AudioConfig, videoConfig: VideoConfig)

Configures both video and audio settings. It is the first method to call after a BaseStreamer instantiation. It must be call when both stream and audio and video capture are not running.

Link copied to clipboard
open suspend override fun connect(url: String)

Connect to an remove server. To avoid creating an unresponsive UI, do not call on main thread.

Link copied to clipboard
open override fun disconnect()

Disconnect from the remote server.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T> IStreamer.getStreamer(): T?

Get a streamer if it from generic class or interface

Link copied to clipboard
open override fun release()

Releases recorders and encoders object. It also stops preview if needed

Link copied to clipboard
Link copied to clipboard
open suspend override fun startStream()

Same as BaseStreamer but it prepares ScreenSource.encoderSurface. You must have set activityResult before.

open suspend override fun startStream(url: String)

Connect to a remote server and start stream. Same as calling connect, then startStream. To avoid creating an unresponsive UI, do not call on main thread.

Link copied to clipboard
open suspend override fun stopStream()

Stops audio/video stream.