Share a camera or external source
The screen is the most common share source, but the Video SDK for Android also lets you share a camera as content or an external frame source. Both run through the same ZoomVideoSDKShareHelper as a screen share, and you stop them the same way with stopShare. For the shared start/stop lifecycle, see Core features.
Share a camera as content
startShareCamera broadcasts a camera as a separate content stream, distinct from the user's normal video, useful for document cameras or a second perspective. The user must already be sending video; otherwise the call returns Errors_Session_Share_Camera_Video_Not_Start.
Add a ZoomVideoSDKCameraShareView to your layout, then pass it to startShareCamera.
<us.zoom.sdk.ZoomVideoSDKCameraShareView
android:id="@+id/camera_share_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
val cameraShareView = findViewById<ZoomVideoSDKCameraShareView>(R.id.camera_share_view)
val result = ZoomVideoSDK.getInstance().shareHelper.startShareCamera(cameraShareView)
if (result != ZoomVideoSDKErrors.Errors_Success) {
// Handle the error (most commonly, user hasn't started video yet).
}
ZoomVideoSDKCameraShareView cameraShareView = findViewById(R.id.camera_share_view);
int result = ZoomVideoSDK.getInstance().getShareHelper().startShareCamera(cameraShareView);
if (result != ZoomVideoSDKErrors.Errors_Success) {
// Handle the error (most commonly, user hasn't started video yet).
}
Share an external source
startSharingExternalSource feeds frames from a custom pipeline (a USB capture device, a media file decoder, an AR overlay) through the SDK. Implement ZoomVideoSDKShareSource for video and (optionally) ZoomVideoSDKShareAudioSource for audio.
val source: ZoomVideoSDKShareSource = MyShareSource()
val audioSource: ZoomVideoSDKShareAudioSource = MyShareAudioSource() // or null
ZoomVideoSDK.getInstance().shareHelper.startSharingExternalSource(
source,
audioSource,
true // bPlaying — start emitting frames immediately
)
ZoomVideoSDKShareSource source = new MyShareSource();
ZoomVideoSDKShareAudioSource audioSource = new MyShareAudioSource(); // or null
ZoomVideoSDK.getInstance().getShareHelper().startSharingExternalSource(
source,
audioSource,
true // bPlaying — start emitting frames immediately
);
Frame format, callback timing, and the rest of the source-implementation surface live alongside the raw data APIs. See the ZoomVideoSDKShareHelper reference for the full source interfaces.