IVideoSingleStreamer

Properties

Link copied to clipboard
abstract val isOpenFlow: StateFlow<Boolean>

Returns true if output is opened. For example, if the streamer is connected to a server if the endpoint is SRT or RTMP.

Link copied to clipboard

Whether the video source has a preview.

Link copied to clipboard
abstract val isStreamingFlow: StateFlow<Boolean>

Returns true if stream is running.

Link copied to clipboard
abstract val throwableFlow: StateFlow<Throwable?>

Returns the last throwable that occurred.

Link copied to clipboard
abstract val videoConfigFlow: StateFlow<VideoConfig?>

The video configuration flow.

Link copied to clipboard
abstract val videoEncoder: IEncoder?

Advanced settings for the video encoder.

Link copied to clipboard
abstract val videoSourceFlow: StateFlow<IVideoSource?>

A video source flow to access to advanced settings.

Functions

Link copied to clipboard
abstract suspend fun close()

Closes the streamer endpoint.

Link copied to clipboard
abstract suspend fun release()

Clean and reset the streamer.

Link copied to clipboard

Clean and reset the streamer synchronously.

Link copied to clipboard

Sets activity result from ComponentActivity.registerForActivityResult callback.

Link copied to clipboard
@RequiresPermission(value = "android.permission.CAMERA")
suspend fun IWithVideoSource.setCameraId(cameraId: String)

Sets the camera id.

Link copied to clipboard
suspend fun IWithVideoSource.setPreview(surface: Surface)

Sets the preview surface.

suspend fun IWithVideoSource.setPreview(surfaceHolder: SurfaceHolder)

Sets a preview surface holder.

suspend fun IWithVideoSource.setPreview(surfaceView: SurfaceView)
suspend fun IWithVideoSource.setPreview(textureView: TextureView)

Sets a preview surface.

Link copied to clipboard
abstract suspend fun setTargetRotation(rotation: Int)

Sets the target rotation.

Link copied to clipboard
abstract suspend fun setVideoConfig(videoConfig: VideoConfig)

Configures only video settings.

Link copied to clipboard
abstract suspend fun setVideoSource(videoSourceFactory: IVideoSourceInternal.Factory)

Sets the video source.

Link copied to clipboard

Starts video preview.

suspend fun IWithVideoSource.startPreview(surface: Surface)
@RequiresPermission(value = "android.permission.CAMERA")
suspend fun IWithVideoSource.startPreview(surfaceHolder: SurfaceHolder)
@RequiresPermission(value = "android.permission.CAMERA")
suspend fun IWithVideoSource.startPreview(surfaceView: SurfaceView)
@RequiresPermission(value = "android.permission.CAMERA")
suspend fun IWithVideoSource.startPreview(textureView: TextureView)

Sets preview surface and start video preview.

Link copied to clipboard
abstract suspend fun startStream()

Starts audio/video stream.

Link copied to clipboard

Stops video preview.

Link copied to clipboard
abstract suspend fun stopStream()

Stops audio/video stream.