VideoOnlySingleStreamer

class VideoOnlySingleStreamer(context: Context, endpointFactory: IEndpointInternal.Factory = DynamicEndpointFactory(), defaultRotation: Int = context.displayRotation) : ISingleStreamer, IVideoSingleStreamer

A ISingleStreamer implementation for video only (without audio).

Parameters

context

the application context

endpointFactory

the IEndpointInternal.Factory implementation. By default, it is a DynamicEndpointFactory.

defaultRotation

the default rotation in Surface rotation (Surface.ROTATION_0, ...). By default, it is the current device orientation.

Constructors

Link copied to clipboard
constructor(context: Context, endpointFactory: IEndpointInternal.Factory = DynamicEndpointFactory(), defaultRotation: Int = context.displayRotation)

Properties

Link copied to clipboard
open override val endpoint: IEndpoint

Advanced settings for the endpoint.

Link copied to clipboard
open override val info: IConfigurationInfo

Configuration information

Link copied to clipboard
open override 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
open override val isStreamingFlow: StateFlow<Boolean>

Returns true if stream is running.

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

Returns the last throwable that occurred.

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

The video configuration flow.

Link copied to clipboard
open override val videoEncoder: IEncoder?

Advanced settings for the video encoder.

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

A video source flow to access to advanced settings.

Functions

Link copied to clipboard

Adds a bitrate regulator controller to the streamer.

Link copied to clipboard
open suspend override fun close()

Closes the streamer endpoint.

Link copied to clipboard
open override fun getInfo(descriptor: MediaDescriptor): IConfigurationInfo

Gets configuration information

Link copied to clipboard
open suspend override fun open(descriptor: MediaDescriptor)

Opens the streamer endpoint.

Link copied to clipboard
suspend fun IOpenableStreamer.open(uri: Uri)
suspend fun IOpenableStreamer.open(uriString: String)

Opens the streamer endpoint.

Link copied to clipboard
open suspend override fun release()

Clean and reset the streamer.

Link copied to clipboard

Clean and reset the streamer synchronously.

Link copied to clipboard

Removes the bitrate regulator controller from the streamer.

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
open suspend override fun setTargetRotation(rotation: Int)

Sets the target rotation.

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

Configures only video settings.

Link copied to clipboard
open suspend override 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
open suspend override fun startStream()

Starts audio/video stream.

Link copied to clipboard
suspend fun IOpenableStreamer.startStream(uriString: String)

Starts audio/video stream.

Link copied to clipboard

Stops video preview.

Link copied to clipboard
open suspend override fun stopStream()

Stops audio/video stream.