Camera Mode

Camera Mode allows developers to create apps and put content in the camera without having to create and install a virtual camera driver on the user's computer.

Prerequisites

Zoom App APIs

Behavior

After calling runRenderingContext({view: "camera"}) Zoom attempts to install Chromium Embedded Framework (CEF) if it has not been previously installed by another Zoom app entering camera mode. Once it has been installed the CEF process starts, and loads your home URL.

This takes time and may result in errors due to race conditions. In this case, the CEF may not have completed loading when the Zoom App calls drawWebView and cannot place the WebView in the right place yet. Because the Zoom App is unaware that CEF was not loaded it thinks there is an error in the client.

Best Practice

There are two ways to ensure the CEF has finished initializing and you're in camera mode to avoid race conditions. Before calling drawParticipant and drawWebView:

  • Check the runningContext to make sure the context is inCamera. (Preferred).
  • Wait for the onRenderedAppOpened event.

When using drawParticipant and drawWebView first try using the renderTarget sizes to make the content fill the camera view before trying other options. And always use the correct zIndex ordering.

Example:

zoomSdk.drawParticipant({
    participantUUID: myParticipantUUID,
    x: 0,
    y: 0,
    width: config.media.renderTarget.width,
    height: config.media.renderTarget.height,
    zIndex: 1,
});
zoomSdk.drawWebView({
    WebViewId: "camera",
    x: 0,
    y: 0,
    width: config.media.renderTarget.width,
    height: config.media.renderTarget.height,
    zIndex: 2,
});

Resources