CustomStreamTrack class

A camera, microphone or screen-share track created before the room.

Make one with VideoSDK.createCameraVideoTrack or VideoSDK.createMicrophoneAudioTrack, preview it with a RTCVideoRenderer, then hand it to VideoSDK.createRoom so the room starts with exactly the settings the user picked.

The track itself lives in the native engine; mediaStream is the handle to it. Call stop when you are done — a track that is neither joined with nor stopped keeps the camera open.

Properties

audioEncoderConfig ↔ CustomMicrophoneTrackConfig
The audio profile this track was built with. Only set on a CustomTrackKind.AUDIO track.
getter/setter pair
bitrateMode ↔ BitrateMode
How the encoder trades video quality against bandwidth.
getter/setter pair
cameraId ↔ String?
The device id of the camera this track opened, when one was named.
getter/setter pair
codec ↔ VideoCodec
The codec the track encodes video with.
getter/setter pair
encoderConfig ↔ CustomCameraTrackConfig
The video profile this track was built with. Only set on a CustomTrackKind.VIDEO track.
getter/setter pair
facingMode ↔ FacingMode?
Which way the camera points, when the track was opened by direction rather than by device id.
getter/setter pair
isEnded → bool
True once stop has run or the track ended on its own. An ended track cannot be joined with.
no setter
kind ↔ CustomTrackKind
Whether this is a camera, microphone or screen-share track.
getter/setter pair
maxLayer ↔ EncodingLayer
The highest simulcast layer the track publishes.
getter/setter pair
mediaStream ↔ NativeMediaStream
Handle to the media the native engine captured for this track.
getter/setter pair
microphoneId ↔ String?
The device id of the microphone this track opened, when one was named.
getter/setter pair
multiStream ↔ bool
Whether the track publishes simulcast layers rather than a single stream.
getter/setter pair
noiseConfig ↔ NoiseConfig?
Audio-processing switches applied to a microphone track, as passed to VideoSDK.createMicrophoneAudioTrack.
getter/setter pair
onEnded ↔ void Function(VideoSDKError? error)?
Called once when the track ends: with the error when the device was lost, taken by another app or had its access revoked, or null for stop, a disable or leaving the room. Set after the track ended, it is called at once and not kept.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shareEncoderConfig ↔ CustomScreenShareTrackConfig
The screen-share profile this track was built with. Only set on a CustomTrackKind.SHARE track.
getter/setter pair
withAudio ↔ bool
Whether a screen-share track also captures system audio into the microphone track. Android only — ReplayKit has no equivalent.
getter/setter pair

Methods

stop() → Future<void>
Releases the track and the device behind it.