ApiVideoLiveStream

class ApiVideoLiveStream @RequiresPermission(allOf = ["android.permission.RECORD_AUDIO", "android.permission.CAMERA"]) constructor(context: Context, apiVideoView: ApiVideoView, connectionListener: IConnectionListener, permissionRequester: (List<String>, onGranted: () -> Unit) -> Unit = { _, onGranted -> onGranted() })

Manages both livestream and camera preview.

Constructors

Link copied to clipboard
@RequiresPermission(allOf = ["android.permission.RECORD_AUDIO", "android.permission.CAMERA"])
constructor(context: Context, apiVideoView: ApiVideoView, connectionListener: IConnectionListener, permissionRequester: (List<String>, onGranted: () -> Unit) -> Unit = { _, onGranted -> onGranted() })

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
@set:RequiresPermission(value = "android.permission.RECORD_AUDIO")
var audioConfig: AudioConfig?

Sets/gets audio configuration once you have created the a ApiVideoLiveStream instance.

Link copied to clipboard

Get/set current camera.

Link copied to clipboard

Get/set current camera facing direction.

Link copied to clipboard

Mute/Unmute microphone

Link copied to clipboard

Check the streaming state.

Link copied to clipboard

Get/set video bitrate during a streaming in bps. Value will be reset to provided VideoConfig.startBitrate for a new stream.

Link copied to clipboard
@set:RequiresPermission(value = "android.permission.CAMERA")
var videoConfig: VideoConfig?

Sets/gets video configuration once you have created the a ApiVideoLiveStream instance.

Link copied to clipboard

Set/get the zoom ratio.

Functions

Link copied to clipboard
fun release()

Release internal elements.

Link copied to clipboard
@RequiresPermission(value = "android.permission.CAMERA")
fun startPreview()

Starts camera preview of cameraPosition.

Link copied to clipboard
fun startStreaming(streamKey: String, url: String = context.getString(R.string.default_rtmp_url))

Start a new RTMP stream.

Link copied to clipboard

Stops camera preview.

Link copied to clipboard

Stops running stream.