create Camera Video Track
Creates a custom camera video track with full control over simulcast layers and bitrate mode.
Use this to create a video track before joining a meeting or to replace the active video track during a meeting using enableWebcam. This is the most configurable overload, allowing you to specify the maximum number of simulcast layers and the bitrate mode in addition to the standard video configuration.
Return
A CustomStreamTrack for the camera, or null if creation fails (e.g., camera permission denied).
Code Example:
val videoTrack = VideoSDK.createCameraVideoTrack(
"h720p_w1280p", // 720p resolution
"front", // front camera
CustomStreamTrack.VideoMode.MOTION, // optimize for motion
true, // enable simulcast
context,
null, // use default camera
3, // 3 simulcast layers
BitrateMode.HIGH_QUALITY // higher quality bitrate
)
// Use the track when enabling webcam
meeting.enableWebcam(videoTrack)
Parameters
Video resolution preset (e.g., "h480p_w720p", "h720p_w1280p"). If null or empty, defaults to "h480p_w720p". Available presets: "h144p_w176p", "h240p_w320p", "h360p_w640p", "h480p_w640p", "h480p_w720p", "h720p_w960p", "h720p_w1280p", "h1080p_w1440p".
Camera facing mode: "front" or "back".
Video optimization mode. MOTION prioritizes frame rate (ideal for video calls), while TEXT prioritizes resolution (ideal for screen content). See CustomStreamTrack.VideoMode.
If true, enables simulcast encoding (multiple quality layers sent to the server). Required for adaptive subscription and per-participant quality control via setViewPort or setQuality.
Application context.
(Optional) Specific camera device. Use getVideoDevices to enumerate available cameras. If null, the default camera for the specified facingMode is used.
(Optional) Maximum number of simulcast layers (e.g., 2, or 3). More layers provide finer quality adaptation at the cost of higher encoding overhead. Only effective when multiStream is true. If null, the SDK default is used.
(Optional) The bitrate mode for encoding. HIGH_QUALITY provides better quality at the expense of higher bandwidth, BALANCED is suitable for most conditions, and BANDWIDTH_OPTIMIZED conserves bandwidth. If null, the SDK default is used. See BitrateMode.