ApiVideoUpstream

class ApiVideoUpstream @RequiresPermission(allOf = ["android.permission.RECORD_AUDIO", "android.permission.CAMERA"]) constructor(    context: Context,     apiVideoView: ApiVideoView,     apiKey: String? = null,     environment: Environment = Environment.PRODUCTION,     timeout: Int? = null,     appName: String? = null,     appVersion: String? = null,     partSize: Long = ApiClient.DEFAULT_CHUNK_SIZE,     initialAudioConfig: AudioConfig?,     initialVideoConfig: VideoConfig?,     initialCamera: CameraFacingDirection = CameraFacingDirection.BACK,     initialSessionListener: SessionListener? = null,     initialSessionUploadPartListener: SessionUploadPartListener? = null,     streamerListener: StreamerListener? = null)

Main API class. A audio and video streamer capture the microphone and the camera stream and generates parts of video.

Parameters

context

The application context

apiVideoView

where to display preview. Could be null if you don't have a preview.

apiKey

The API key. If null, only upload with upload token will be possible.

environment

The environment to use. Default is Environment.PRODUCTION.

timeout

The timeout in seconds.

appName

The application name. If set, you also must set the appVersion.

appVersion

The application version. If srt, you also must set the appName.

partSize

The part size in bytes (minimum is 5242880 bytes, maximum is 134217728 bytes)

initialAudioConfig

initial audio configuration. Could be change later with audioConfig field.

initialVideoConfig

initial video configuration. Could be change later with videoConfig field.

initialCamera

initial camera. Could be change later with camera field.

initialSessionListener

The listener for one full video

initialSessionUploadPartListener

The listener for a part of a video

streamerListener

The listener for the streamer

Constructors

Link copied to clipboard
@RequiresPermission(allOf = ["android.permission.RECORD_AUDIO", "android.permission.CAMERA"])
fun ApiVideoUpstream(    context: Context,     apiVideoView: ApiVideoView,     apiKey: String? = null,     environment: Environment = Environment.PRODUCTION,     timeout: Int? = null,     appName: String? = null,     appVersion: String? = null,     partSize: Long = ApiClient.DEFAULT_CHUNK_SIZE,     initialAudioConfig: AudioConfig?,     initialVideoConfig: VideoConfig?,     initialCamera: CameraFacingDirection = CameraFacingDirection.BACK,     initialSessionListener: SessionListener? = null,     initialSessionUploadPartListener: SessionUploadPartListener? = null,     streamerListener: StreamerListener? = null)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun loadExistingSession(sessionId: String): MultiFileUploader

Loads a session from the internal store by the sessionId.

Link copied to clipboard
fun release()

Releases internal elements.

Link copied to clipboard
fun removeSession(sessionId: String)

Removes a session from the internal store by the sessionId.

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

Starts camera preview of camera.

Link copied to clipboard
fun startStreamingForToken(token: String, videoId: String? = null): MultiFileUploader

Starts the upstream process for an upload token.

Link copied to clipboard
fun startStreamingForVideoId(videoId: String): MultiFileUploader

Starts the upstream process for a video id.

Link copied to clipboard
fun stopPreview()

Stops camera preview.

Link copied to clipboard
fun stopStreaming()

Stops the upstream process.

Properties

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

Set/get audio configuration once you have created the a ApiVideoUpstream instance.

Link copied to clipboard
var camera: CameraFacingDirection

Get/set current camera facing direction.

Link copied to clipboard
var isMuted: Boolean

Mute/Unmute microphone

Link copied to clipboard
val isStreaming: Boolean

Check the streaming state.

Link copied to clipboard
var sessionListener: SessionListener?
Link copied to clipboard
var sessionUploadPartListener: SessionUploadPartListener?
Link copied to clipboard
val storedSessionsId: List<String>

Gets the list of all stored sessions id.

Link copied to clipboard
@set:RequiresPermission(allOf = ["android.permission.CAMERA", "android.permission.RECORD_AUDIO"])
var videoConfig: VideoConfig?

Set/get video configuration once you have created the a ApiVideoUpstream instance.