Core features

The Video SDK for Android lets you programmatically control user video during a session: check video status, start video, stop video, and render one or many users. For switching, mirroring, rotating, and other per-device camera operations, see Camera controls.

Camera permission required.

Before using video, your app must request the CAMERA runtime permission. For the runtime-permission flow, see the Android permissions overview.

Check whether video is on

To check whether a user has their video on, call isOn on videoStatus to get a boolean response indicating whether the user has their video on or not in the session.

val isVideoOn = user.videoCanvas.videoStatus.isOn
boolean isVideoOn = user.getVideoCanvas().getVideoStatus().isOn();

Start video

Start video by calling startVideo() on the VideoHelper. Be sure your app has been granted CAMERA permission before calling or the SDK can't capture from the camera.

val videoHelper = ZoomVideoSDK.getInstance().videoHelper
videoHelper.startVideo()
ZoomVideoSDKVideoHelper videoHelper = ZoomVideoSDK.getInstance().getVideoHelper();
videoHelper.startVideo();

Stop video

Stop video by calling stopVideo() on the VideoHelper.

ZoomVideoSDK.getInstance().videoHelper.stopVideo()
ZoomVideoSDK.getInstance().getVideoHelper().stopVideo();

Render a user's video

To render a user's video, get the user's ZoomVideoSDKVideoCanvas and subscribe a ZoomVideoSDKVideoView to it. The view can be created programmatically or declared in XML.

val videoView = ZoomVideoSDKVideoView(this)
val canvas = user.videoCanvas
canvas.subscribe(videoView, ZoomVideoSDKVideoAspect.ZoomVideoSDKVideoAspect_Original)
ZoomVideoSDKVideoView videoView = new ZoomVideoSDKVideoView(this);
ZoomVideoSDKVideoCanvas canvas = user.getVideoCanvas();
canvas.subscribe(videoView, ZoomVideoSDKVideoAspect.ZoomVideoSDKVideoAspect_Original);
<us.zoom.sdk.ZoomVideoSDKVideoView
    android:id="@+id/video_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

The aspect parameter controls how Zoom fits the video into the view.

TypeDescription
ZoomVideoSDKVideoAspect_OriginalDisplay video without any modifications.
ZoomVideoSDKVideoAspect_Full_FilledStretch the video to fill the canvas.
ZoomVideoSDKVideoAspect_LetterBoxAdd black bars (top/bottom or left/right) so the full frame is visible without cropping.
ZoomVideoSDKVideoAspect_PanAndScanCrop the frame to fill the canvas without bars.

For more on choosing an aspect mode and on responsive layouts, see Aspect ration and orientation.

Remove a user's video from a canvas

When a user leaves the session, or when you want to recycle a ZoomVideoSDKVideoView for a different user, unsubscribe from the canvas.

videoCanvas.unsubscribe(videoView)
videoCanvas.unsubscribe(videoView);

Render multiple users

To render multiple users at once (gallery view), iterate over the users in the session and subscribe a ZoomVideoSDKVideoView for each. Respond to onUserJoin to add new users as they enter, and onUserLeave to unsubscribe.

override fun onUserJoin(userHelper: ZoomVideoSDKUserHelper, userList: MutableList<ZoomVideoSDKUser>) {
    userList.forEach { user ->
        val videoView = ZoomVideoSDKVideoView(this@MyActivity)
        user.videoCanvas.subscribe(videoView, ZoomVideoSDKVideoAspect.ZoomVideoSDKVideoAspect_Original)
        // add videoView to your gallery container
    }
}
override fun onUserLeave(userHelper: ZoomVideoSDKUserHelper, userList: MutableList<ZoomVideoSDKUser>) {
    userList.forEach { user ->
        // unsubscribe and remove the corresponding view from the container
    }
}
@Override
public void onUserJoin(ZoomVideoSDKUserHelper userHelper, List<ZoomVideoSDKUser> userList) {
    for (ZoomVideoSDKUser user : userList) {
        ZoomVideoSDKVideoView videoView = new ZoomVideoSDKVideoView(this);
        user.getVideoCanvas().subscribe(videoView, ZoomVideoSDKVideoAspect.ZoomVideoSDKVideoAspect_Original);
        // add videoView to your gallery container
    }
}
@Override
public void onUserLeave(ZoomVideoSDKUserHelper userHelper, List<ZoomVideoSDKUser> userList) {
    for (ZoomVideoSDKUser user : userList) {
        // unsubscribe and remove the corresponding view from the container
    }
}

For grid layout, density recommendations, and pagination guidance, see Layout and density.