Generated banner for Zoom Video SDK Web
Generated logo for Zoom Video SDK Web

Zoom Video SDK Web

OpenAIOfficialCreated by ZoomDistributed by OpenAI

  • Skill
  • Tool integration
  • Software development
  • MIT
  • No issues found

From the author

Zoom Video SDK for Web - JavaScript/TypeScript integration for browser-based video sessions, real-time communication, screen sharing, recording, and live transcription
— the description by Zoom

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The Zoom Video SDK for Web provides a robust JavaScript/TypeScript library for building custom, browser-based video communication experiences. Unlike standard Zoom meetings, this SDK allows developers to create fully branded, custom user interfaces for video sessions, screen sharing, live transcription, and collaborative features like whiteboarding. It follows a strict event-driven architecture and requires careful management of the session lifecycle, particularly regarding media stream initialization and participant event handling.

What it does

  • Enables real-time audio and video communication in web browsers.
  • Supports screen sharing and collaborative whiteboarding.
  • Provides tools for cloud recording and live streaming to RTMP endpoints.
  • Includes features for in-session chat and custom command messaging.
  • Facilitates live transcription and breakout room management.
  • Offers granular control over media devices and video quality settings.

When to use it

  • When building a custom-branded video conferencing application.
  • When you need full control over the video UI and participant layout.
  • When integrating real-time communication into existing web platforms.
  • When requiring advanced features like custom video frame processing or live captions.

Advantages

  • Full control over the user interface and user experience.
  • Supports high-definition video and WebRTC for direct peer-to-peer streaming.
  • Comprehensive feature set including chat, recording, and transcription.
  • Well-documented lifecycle patterns for reliable session management.

Usage examples

“How do I join a video session using the Zoom Video SDK?”
The user receives the 5-step lifecycle pattern: create client, initialize, join, get media stream, and start media, with specific warnings to only call getMediaStream() after joining.
“How can I display a remote participant's video?”
The user is guided to use the peer-video-state-change event to trigger attachVideo() and append the resulting video element to the DOM.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/openai/zoom-video-sdk-web/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip zoom-video-sdk-web.zip -d .agents/skills

Documentation by Zoom

Zoom Video SDK - Web Development

Expert guidance for developing with the Zoom Video SDK on Web. This SDK enables custom video applications in the browser with real-time video/audio, screen sharing, cloud recording, live streaming, chat, and live transcription.

This skill is for custom video sessions, not embedded Zoom meetings. If the user wants a custom UI for a real Zoom meeting, route to ../../meeting-sdk/web/component-view/SKILL.md.

Official Documentation: https://developers.zoom.us/docs/video-sdk/web/ API Reference: https://marketplacefront.zoom.us/sdk/custom/web/modules.html Sample Repository: https://github.com/zoom/videosdk-web-sample

New to Video SDK? Follow this path:

  1. SDK Architecture Pattern - Universal 3-step pattern for ANY feature

  2. Session Join Pattern - Complete working code to join a session

  3. Video Rendering - Display video with attachVideo()

  4. Event Handling - Required events for video/audio

Reference:

  • Singleton Hierarchy - 4-level SDK navigation map

  • API Reference - Methods, events, error codes

  • SKILL.md - Complete documentation navigation

  • ../../probe-sdk/SKILL.md - Optional browser/device/network readiness diagnostics before join

Having issues?

  • Video not showing → Video Rendering (use attachVideo, not renderVideo)

  • getMediaStream() returns undefined → Call AFTER join() completes

  • Quick diagnostics → Common Issues

SDK Overview

The Zoom Video SDK for Web is a JavaScript library that provides:

  • Session Management: Join/leave video SDK sessions

  • Video/Audio: Start/stop camera and microphone

  • Screen Sharing: Share screens or browser tabs

  • Cloud Recording: Record sessions to Zoom cloud

  • Live Streaming: Stream to RTMP endpoints

  • Chat: In-session messaging

  • Command Channel: Custom command messaging

  • Live Transcription: Real-time speech-to-text

  • Subsessions: Breakout room support

  • Whiteboard: Collaborative whiteboard features

  • Virtual Background: Blur or custom image backgrounds

Prerequisites

System Requirements
  • Modern Browser: Chrome 80+, Firefox 75+, Safari 14+, Edge 80+

  • Video SDK Credentials: SDK Key and Secret from Marketplace

  • JWT Token: Server-side generated signature

Browser Feature Requirements
// Check browser compatibility before init
const compatibility = ZoomVideo.checkSystemRequirements();
console.log('Audio:', compatibility.audio);
console.log('Video:', compatibility.video);
console.log('Screen:', compatibility.screen);

// Check feature support
const features = ZoomVideo.checkFeatureRequirements();
console.log('Supported:', features.supportFeatures);
console.log('Unsupported:', features.unSupportFeatures);

Use Probe SDK as a readiness gate before client.join(...) when you need to reduce failed starts:

  1. Run diagnostics with ../../probe-sdk/SKILL.md.

  2. Evaluate policy (allow, warn, block).

  3. Start Video SDK join only when policy allows.

Cross-skill flow: ../../general/use-cases/probe-sdk-preflight-readiness-gate.md

Installation

npm install @zoom/videosdk
import ZoomVideo from '@zoom/videosdk';

Note: Some networks/ad blockers can block source.zoom.us. If you see flaky loads, first try allowlisting the domain in your environment. If needed, consider a fallback (mirror/self-host) only if it's permitted for your use case and you can keep versions in sync.

# Download SDK locally
curl "https://source.zoom.us/videosdk/zoom-video-2.3.12.min.js" -o public/js/zoom-video-sdk.min.js
<!-- Use local copy instead of CDN -->
<script src="js/zoom-video-sdk.min.js"></script>
// CDN exports as WebVideoSDK, NOT ZoomVideo
const ZoomVideo = WebVideoSDK.default;

Quick Start

import ZoomVideo from '@zoom/videosdk';

// 1. Create client (singleton - returns same instance)
const client = ZoomVideo.createClient();

// 2. Initialize SDK
await client.init('en-US', 'Global', { patchJsMedia: true });

// 3. Join session
await client.join(topic, signature, userName, password);

// 4. CRITICAL: Get stream AFTER join
const stream = client.getMediaStream();

// 5. Start media
await stream.startVideo();
await stream.startAudio();

// 6. Attach video to DOM
const videoElement = await stream.attachVideo(userId, VideoQuality.Video_360P);
document.getElementById('video-container').appendChild(videoElement);

SDK Lifecycle (CRITICAL ORDER)

The SDK has a strict lifecycle. Violating it causes silent failures.

1. Create client:     client = ZoomVideo.createClient()
2. Initialize:        await client.init('en-US', 'Global', options)
3. Join session:      await client.join(topic, signature, userName, password)
4. Get stream:        stream = client.getMediaStream()  ← ONLY AFTER JOIN
5. Start media:       await stream.startVideo() / await stream.startAudio()

Common Mistake:

// WRONG: Getting stream before joining
const stream = client.getMediaStream();  // Returns undefined!
await client.join(...);

// CORRECT: Get stream after joining
await client.join(...);
const stream = client.getMediaStream();  // Works!

Critical Gotchas and Best Practices

getMediaStream() ONLY Works After join()

The #1 issue that causes video/audio to fail:

// WRONG
const stream = client.getMediaStream();  // undefined!
await client.join(...);

// CORRECT
await client.join(...);
const stream = client.getMediaStream();  // Works
Use attachVideo() NOT renderVideo()

renderVideo() is deprecated. Use attachVideo() which returns a VideoPlayer element:

import { VideoQuality } from '@zoom/videosdk';

// CORRECT: attachVideo returns element to append
const videoElement = await stream.attachVideo(userId, VideoQuality.Video_360P);
document.getElementById('video-container').appendChild(videoElement);

// WRONG: renderVideo is deprecated
await stream.renderVideo(canvas, userId, ...);  // Don't use!
Video Rendering is Event-Driven (CRITICAL)

You MUST listen for events to properly render participant videos:

// When another participant's video state changes
client.on('peer-video-state-change', async (payload) => {
  const { action, userId } = payload;

  if (action === 'Start') {
    // Participant turned on video - attach it
    const element = await stream.attachVideo(userId, VideoQuality.Video_360P);
    container.appendChild(element);
  } else if (action === 'Stop') {
    // Participant turned off video - detach it
    await stream.detachVideo(userId);
  }
});

// When participants join/leave
client.on('user-added', (payload) => {
  // New participant joined - check if their video is on
  const users = client.getAllUser();
  // Render videos for users with bVideoOn === true
});

client.on('user-removed', (payload) => {
  // Participant left - clean up their video element
  stream.detachVideo(payload[0].userId);
});
Peer Video on Mid-Session Join

Existing participants' videos won't auto-render when you join mid-session.

// After joining, render existing participants' videos
const renderExistingVideos = async () => {
  await new Promise(resolve => setTimeout(resolve, 500));

  const users = client.getAllUser();
  const currentUserId = client.getCurrentUserInfo().userId;

  for (const user of users) {
    if (user.bVideoOn && user.userId !== currentUserId) {
      const element = await stream.attachVideo(user.userId, VideoQuality.Video_360P);
      document.getElementById(`video-${user.userId}`).appendChild(element);
    }
  }
};
CDN Race Condition with ES Modules

When using <script type="module"> with CDN, the SDK may not be loaded yet:

function waitForSDK(timeout = 10000) {
  return new Promise((resolve, reject) => {
    if (typeof WebVideoSDK !== 'undefined') {
      resolve();
      return;
    }
    const start = Date.now();
    const check = setInterval(() => {
      if (typeof WebVideoSDK !== 'undefined') {
        clearInterval(check);
        resolve();
      } else if (Date.now() - start > timeout) {
        clearInterval(check);
        reject(new Error('SDK failed to load'));
      }
    }, 100);
  });
}

await waitForSDK();
const ZoomVideo = WebVideoSDK.default;
SharedArrayBuffer for HD Video

For optimal performance and HD video, configure these headers on your server:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

Note: As of v1.11.2, SharedArrayBuffer is elective (not strictly required).

Check HD Capability Before Enabling
const stream = client.getMediaStream();

// Check if 720p is supported
const hdSupported = stream.isSupportHDVideo();

// Get maximum video quality
const maxQuality = stream.getVideoMaxQuality();
// 0=90P, 1=180P, 2=360P, 3=720P, 4=1080P

// Start video with HD
if (hdSupported) {
  await stream.startVideo({ hd: true });
}
Screen Share Rendering Mode Check
const stream = client.getMediaStream();

// Check which element type to use
if (stream.isStartShareScreenWithVideoElement()) {
  // Use video element
  const video = document.getElementById('share-video');
  await stream.startShareScreen(video as unknown as HTMLCanvasElement);
} else {
  // Use canvas element
  const canvas = document.getElementById('share-canvas');
  await stream.startShareScreen(canvas);
}

Key Features

Video Quality Enum
import { VideoQuality } from '@zoom/videosdk';

VideoQuality.Video_90P   // 0
VideoQuality.Video_180P  // 1
VideoQuality.Video_360P  // 2 (recommended for most cases)
VideoQuality.Video_720P  // 3
VideoQuality.Video_1080P // 4
Virtual Backgrounds
const stream = client.getMediaStream();

// Always check support first
if (stream.isSupportVirtualBackground()) {
  // Blur background
  await stream.updateVirtualBackgroundImage('blur');

  // Custom image background
  await stream.updateVirtualBackgroundImage('https://example.com/bg.jpg');

  // Remove virtual background
  await stream.updateVirtualBackgroundImage(undefined);
}
Video Processor (Custom Effects)

The VideoProcessor class allows you to intercept and modify video frames:

// video-processor-worker.js
class MyVideoProcessor extends VideoProcessor {
  processFrame(input, output) {
    const ctx = output.getContext('2d');
    ctx.drawImage(input, 0, 0);

    // Add overlay
    ctx.fillStyle = 'white';
    ctx.font = '24px Arial';
    ctx.fillText('Live', 20, 40);

    return true;
  }
}
WebRTC Mode

Enable WebRTC mode for direct peer-to-peer streaming with HD video support:

await client.init('en-US', 'Global', {
  patchJsMedia: true,
  webrtc: true  // Enable WebRTC mode
});

Feature Clients

Access specialized clients from the VideoClient:

ClientAccess MethodPurpose
Streamclient.getMediaStream()Video, audio, screen share, devices
Chatclient.getChatClient()Send/receive messages
Commandclient.getCommandClient()Custom commands (reactions, etc.)
Recordingclient.getRecordingClient()Cloud recording control
Transcriptionclient.getLiveTranscriptionClient()Live captions
LiveStreamclient.getLiveStreamClient()RTMP streaming
Subsessionclient.getSubsessionClient()Breakout rooms
Whiteboardclient.getWhiteboardClient()Collaborative whiteboard

Common Tasks

Start/Stop Video
await stream.startVideo();
await stream.stopVideo();
Start/Stop Audio
await stream.startAudio();
await stream.muteAudio();
await stream.unmuteAudio();
await stream.stopAudio();
Switch Devices
// Get available devices
const cameras = stream.getCameraList();
const mics = stream.getMicList();
const speakers = stream.getSpeakerList();

// Switch devices
await stream.switchCamera(cameraId);
await stream.switchMicrophone(micId);
await stream.switchSpeaker(speakerId);
Screen Sharing
// Start sharing
await stream.startShareScreen(canvas);

// Stop sharing
await stream.stopShareScreen();

// Receive share
client.on('active-share-change', async (payload) => {
  if (payload.state === 'Active') {
    await stream.startShareView(canvas, payload.userId);
  } else {
    await stream.stopShareView();
  }
});
Chat
const chatClient = client.getChatClient();

// Send to everyone
await chatClient.send('Hello, everyone!');

// Send to specific user
await chatClient.sendToUser(userId, 'Private message');

// Receive messages
client.on('chat-on-message', (payload) => {
  console.log(`${payload.sender.name}: ${payload.message}`);
});
Recording (Host Only)
const recordingClient = client.getRecordingClient();

await recordingClient.startCloudRecording();
await recordingClient.stopCloudRecording();

client.on('recording-change', (payload) => {
  console.log('Recording status:', payload.state);
});
Leave/End Session
// Leave session (others stay)
await client.leave();

// End session for ALL participants (host only)
await client.leave(true);

Error Handling

Common Join Errors
ErrorCauseSolution
Invalid signatureJWT expired or malformedGenerate new signature
Session does not existHost hasn't started yetShow "waiting" message, retry
Permission deniedUser denied camera/micRequest permission again
Example Error Handler
try {
  await client.join(topic, signature, userName, password);
} catch (error) {
  if (error.reason?.includes('signature')) {
    // Regenerate signature and retry
  } else if (error.reason?.includes('Session')) {
    // Show "Waiting for host..." and poll
  } else if (error.reason?.includes('Permission')) {
    // Guide user to enable permissions
  }
  console.error('Join failed:', error);
}

Browser Compatibility

FeatureChromeFirefoxSafariEdge
Video80+75+14+80+
Audio80+75+14+80+
Screen Share80+75+15+80+
Virtual BG80+90+-80+

Safari Notes:

  • Virtual background not supported

  • Screen sharing requires macOS 15+

CORS Errors (Telemetry)

CORS errors to log-external-gateway.zoom.us are harmless.

These are caused by COOP/COEP headers blocking telemetry requests. They don't affect SDK functionality.

Complete Documentation Library

Core Concepts
Complete Examples
Framework Integrations
Troubleshooting
References

Official Sample Repositories

Resources


Need help? Start with SKILL.md for complete navigation.

Merged from video-sdk/web/SKILL.md

Zoom Video SDK Web - Complete Documentation Index

Quick Start Path

If you're new to the SDK, follow this order:

  1. Read the architecture pattern → concepts/sdk-architecture-pattern.md

    • Universal formula: Create Client → Init → Join → Get Stream → Use

    • Once you understand this, you can implement any feature

  2. Implement session join → examples/session-join-pattern.md

    • Complete working JWT + session join code

  3. Listen to events → examples/event-handling.md

    • CRITICAL: The SDK is event-driven, you must listen for events

  4. Implement video → examples/video-rendering.md

    • Use attachVideo(), NOT renderVideo()

  5. Troubleshoot any issues → troubleshooting/common-issues.md

    • Quick diagnostic checklist

    • Error code tables


Documentation Structure

video-sdk/web/
├── SKILL.md                           # Main skill overview
├── SKILL.md                           # This file - navigation guide
│
├── concepts/                          # Core architectural patterns
│   ├── sdk-architecture-pattern.md   # Universal formula for ANY feature
│   └── singleton-hierarchy.md        # 4-level navigation guide
│
├── examples/                          # Complete working code
│   ├── session-join-pattern.md       # JWT auth + session join
│   ├── video-rendering.md            # attachVideo() patterns
│   ├── screen-share.md               # Send and receive screen shares
│   ├── event-handling.md             # Required events
│   ├── chat.md                       # Chat implementation
│   ├── command-channel.md            # Command channel messaging
│   ├── recording.md                  # Cloud recording control
│   ├── transcription.md              # Live transcription/captions
│   ├── react-hooks.md                # Official @zoom/videosdk-react library
│   └── framework-integrations.md     # Next.js, Vue/Nuxt, ZFG patterns
│
├── troubleshooting/                   # Problem solving guides
│   └── common-issues.md              # Quick diagnostic workflow
│
└── references/                        # Reference documentation
    ├── web-reference.md              # API hierarchy, methods, error codes
    └── events-reference.md           # All event types

By Use Case

I want to build a video app
  1. SDK Architecture Pattern - Understand the pattern

  2. Session Join Pattern - Join sessions

  3. Video Rendering - Display video

  4. Event Handling - Listen for video events

I'm getting runtime errors
  1. Common Issues - Error code tables

  2. "getMediaStream() is undefined" → Call AFTER join() completes

I want to receive screen shares
  1. Screen Share - startShareView() patterns

  2. Event Handling - active-share-change event

I want to send screen shares
  1. Screen Share - startShareScreen() patterns

  2. Check isStartShareScreenWithVideoElement() for element type

I want to use chat
  1. Chat - Send/receive messages

  2. getChatClient() for ChatClient access

I want to record sessions
  1. Recording - Cloud recording (host only)

  2. getRecordingClient() for RecordingClient access

I want to use live transcription
  1. Transcription - Enable live captions

  2. getLiveTranscriptionClient() for LiveTranscriptionClient access

I want to use command channel
  1. Command Channel - Custom signaling between participants

  2. Must call getCommandClient() AFTER join()

I want to implement a specific feature
  1. SDK Architecture Pattern - START HERE!

  2. Singleton Hierarchy - Navigate to the feature

  3. API Reference - Method signatures

I'm using React
  1. React Hooks - Official @zoom/videosdk-react library

  2. Provides hooks: useSession, useSessionUsers, useVideoState, useAudioState

  3. Pre-built components: VideoPlayerComponent, ScreenSharePlayerComponent

I'm using Next.js or Vue/Nuxt
  1. Framework Integrations - SSR considerations

  2. Server-side JWT generation patterns

  3. Client-side only SDK usage


Most Critical Documents

1. SDK Architecture Pattern (MASTER DOCUMENT)

concepts/sdk-architecture-pattern.md

The universal 5-step pattern:

  1. Create client

  2. Initialize SDK

  3. Join session

  4. Get stream

  5. Use features + listen to events

2. Common Issues (MOST COMMON PROBLEMS)

troubleshooting/common-issues.md

Common issues:

  • getMediaStream() returns undefined

  • Video not displaying

  • renderVideo() deprecated

3. Singleton Hierarchy (NAVIGATION MAP)

concepts/singleton-hierarchy.md

4-level deep navigation showing how to reach every feature.


Key Learnings

Critical Discoveries:
  1. getMediaStream() ONLY works after join()

  2. Use attachVideo() NOT renderVideo()

    • renderVideo() is deprecated

    • attachVideo() returns a VideoPlayer element to append to DOM

    • See: Video Rendering

  3. The SDK is Event-Driven

    • You MUST listen for events to render participant videos

    • key events: peer-video-state-change, user-added, user-removed

    • See: Event Handling

  4. Peer Videos on Mid-Session Join

    • Existing participants' videos won't auto-render

    • Must manually iterate getAllUser() and attachVideo()

    • See: Video Rendering

  5. CDN vs NPM

    • CDN exports as WebVideoSDK.default, not ZoomVideo

    • Some networks/ad blockers may block source.zoom.us - allowlist or use a permitted fallback strategy

    • See: Session Join Pattern

  6. SharedArrayBuffer for HD

    • Required for 720p/1080p video

    • Need COOP/COEP headers on server

    • Check with stream.isSupportHDVideo()

  7. Screen Share Element Type

    • Check isStartShareScreenWithVideoElement() for correct element type

    • See: Screen Share

  8. Command Channel Setup Order

    • Must call getCommandClient() AFTER client.join()

    • Register listeners AFTER join, not before

    • Web uses getCommandClient() not getCmdChannel()

    • See: Command Channel

  9. Command Channel is Session-Scoped

    • Does NOT span across different sessions

    • Both sender and receiver must be in the same session


Quick Reference

"getMediaStream() returns undefined"

→ Call AFTER join() completes

"Video not showing"

→ Video Rendering - Use attachVideo(), check events

"renderVideo() doesn't work"

→ Video Rendering - Use attachVideo() instead

"How do I implement [feature]?"

→ SDK Architecture Pattern

"How do I navigate to [client]?"

→ Singleton Hierarchy

"What error code means what?"

→ Common Issues


Document Version

Based on Zoom Video SDK for Web v2.3.x


Happy coding!

Remember: The SDK Architecture Pattern is your key to unlocking the entire SDK. Read it first!

Operations

  • RUNBOOK.md - 5-minute preflight and debugging checklist.

Files

references/web.md

Video SDK - Web

Build custom video experiences in the browser with Zoom Video SDK.

Overview

The Zoom Video SDK for Web enables fully customized video applications using Zoom's infrastructure. You control the UI, branding, and user experience.

Prerequisites

  • Video SDK credentials from Marketplace (sign-in required)

  • SDK Key and Secret

  • Modern browser (Chrome, Firefox, Safari, Edge)

Installation

npm install @zoom/videosdk
CDN (Fallback Strategy)

Note: Some networks/ad blockers can block source.zoom.us. Prefer allowlisting the domain in managed environments. If you need a fallback, consider mirroring/self-hosting only if permitted and you can keep versions in sync.

# Download SDK locally
curl "https://source.zoom.us/videosdk/zoom-video-1.12.0.min.js" -o public/js/zoom-video-sdk.min.js
<!-- Use local copy instead of CDN -->
<script src="js/zoom-video-sdk.min.js"></script>

Note: Remember to update your local copy when new SDK versions are released.

Quick Start

NPM Usage (Bundler)
import ZoomVideo from '@zoom/videosdk';

const client = ZoomVideo.createClient();
await client.init('en-US', 'Global', { patchJsMedia: true });
await client.join(topic, signature, userName, password);

// CRITICAL: getMediaStream() ONLY works AFTER join()
const stream = client.getMediaStream();
await stream.startVideo();
await stream.startAudio();
CDN Usage (No Bundler)
// CDN exports as WebVideoSDK, NOT ZoomVideo
// Must use .default property
const ZoomVideo = WebVideoSDK.default;
const client = ZoomVideo.createClient();

await client.init('en-US', 'Global', { patchJsMedia: true });
await client.join(topic, signature, userName, password);

// CRITICAL: getMediaStream() ONLY works AFTER join()
const stream = client.getMediaStream();
await stream.startVideo();
await stream.startAudio();
ES Module with CDN (Race Condition)

When using <script type="module"> with CDN, the SDK may not be loaded yet:

function waitForSDK(timeout = 10000) {
  return new Promise((resolve, reject) => {
    if (typeof WebVideoSDK !== 'undefined') {
      resolve();
      return;
    }
    const start = Date.now();
    const check = setInterval(() => {
      if (typeof WebVideoSDK !== 'undefined') {
        clearInterval(check);
        resolve();
      } else if (Date.now() - start > timeout) {
        clearInterval(check);
        reject(new Error('SDK failed to load'));
      }
    }, 100);
  });
}

// Usage
await waitForSDK();
const ZoomVideo = WebVideoSDK.default;
const client = ZoomVideo.createClient();

SDK Lifecycle (CRITICAL ORDER)

The SDK has a strict lifecycle. Violating it causes silent failures.

1. Create client:     client = ZoomVideo.createClient()
2. Initialize:        await client.init('en-US', 'Global', options)
3. Join session:      await client.join(topic, signature, userName, password)
4. Get stream:        stream = client.getMediaStream()  ← ONLY AFTER JOIN
5. Start media:       await stream.startVideo() / await stream.startAudio()

Common Mistake:

// ❌ WRONG: Getting stream before joining
const stream = client.getMediaStream();  // Returns undefined!
await client.join(...);

// ✅ CORRECT: Get stream after joining
await client.join(...);
const stream = client.getMediaStream();  // Works!

Video Rendering Best Practices

These show up repeatedly in forum "high CPU", "freezing", and "Safari/Firefox rendering" threads.

  • Prefer a single rendering pipeline/control rather than one independent renderer per participant.

  • Add videos incrementally and measure CPU/GPU usage.

  • Degrade gracefully when isSupportMultipleVideos() is false (mobile Safari, lower-end devices).

  • Consider lower quality subscriptions for non-active speakers.

Key Features

WebRTC Mode

Enable WebRTC mode for direct peer-to-peer streaming with HD video support:

await client.init('en-US', 'Global', {
  patchJsMedia: true,
  webrtc: true  // Enable WebRTC mode
});

Benefits:

  • Up to 1080p HD video

  • Improved performance for direct streaming

Virtual Backgrounds

Check support before using:

const stream = client.getMediaStream();

// Always check support first
if (stream.isSupportVirtualBackground()) {
  // Blur background
  await stream.updateVirtualBackgroundImage('blur');

  // Custom image background
  await stream.updateVirtualBackgroundImage('https://example.com/bg.jpg');

  // Remove virtual background
  await stream.updateVirtualBackgroundImage(undefined);
} else {
  console.log('Virtual backgrounds not supported on this device');
}
HD Video Resolution
Check HD Capability (IMPORTANT)

Always check if HD is supported before enabling:

const stream = client.getMediaStream();

// Check if 720p is supported
const hdSupported = stream.isSupportHDVideo();
console.log('HD (720p) supported:', hdSupported);

// Get maximum video quality (returns VideoQuality enum)
const maxQuality = stream.getVideoMaxQuality();
// 0=90P, 1=180P, 2=360P, 3=720P, 4=1080P

// Check SharedArrayBuffer (required for HD)
const sabAvailable = typeof SharedArrayBuffer === 'function';
if (!sabAvailable) {
  console.warn('HD requires SharedArrayBuffer - enable COOP/COEP headers');
}
Enable HD Video
// Start video with HD quality (720p)
await stream.startVideo({ hd: true });

// Start video with Full HD (1080p)
await stream.startVideo({ hd: true, fullHd: true });

// Subscribe to specific quality
await stream.attachVideo(userId, VideoQuality.Video_720P);
Check Multiple Video Support
// Check if gallery view is possible
const multipleVideosSupported = stream.isSupportMultipleVideos();

// Get max renderable videos
const maxRenderable = stream.getMaxRenderableVideos();
console.log('Can render up to', maxRenderable, 'videos');
Complete HD Detection Flow
async function checkHDCapability(client) {
  // 1. Check SharedArrayBuffer
  const sabAvailable = typeof SharedArrayBuffer === 'function';

  // 2. Check system requirements
  const compatibility = ZoomVideo.checkSystemRequirements();

  // 3. Check feature requirements
  const features = ZoomVideo.checkFeatureRequirements();

  // 4. After joining, check stream capabilities
  const stream = client.getMediaStream();

  return {
    sharedArrayBuffer: sabAvailable,
    videoCompatible: compatibility.video,
    hdSupported: stream.isSupportHDVideo(),
    maxQuality: stream.getVideoMaxQuality(),
    maxRenderable: stream.getMaxRenderableVideos(),
    multipleVideos: stream.isSupportMultipleVideos(),
    virtualBackground: stream.isSupportVirtualBackground()
  };
}

Resolution tiers:

  • 1:1 calls: Up to 1080p

  • Small groups: Up to 720p

  • Larger sessions: Adaptive

Concurrent HD limits:

  • Max 2 concurrent 720p subscriptions

  • Max 1 concurrent 1080p render

Rendering Modes

Multiple rendering options available:

  • WebRTC mode (direct streaming)

  • WebAssembly mode (default)

  • Canvas rendering

  • Video element rendering

Video Processor (Custom Effects)

The VideoProcessor class allows you to intercept and modify video frames before transmission. Use this for custom overlays, effects, face detection, and more.

How It Works
  1. Create a video processor worker

  2. Extend VideoProcessor class

  3. Implement processFrame() to modify each frame

  4. Output to OffscreenCanvas

Basic Example
// video-processor-worker.js
class MyVideoProcessor extends VideoProcessor {
  constructor(port, options) {
    super(port, options);
  }

  processFrame(input, output) {
    const ctx = output.getContext('2d');

    // Draw original frame
    ctx.drawImage(input, 0, 0);

    // Add overlay (e.g., text, graphics)
    ctx.fillStyle = 'white';
    ctx.font = '24px Arial';
    ctx.fillText('Live', 20, 40);

    return true;
  }
}
Face Detection with face-api.js

Combine VideoProcessor with face-api.js for face detection overlays:

// video-processor-worker.js
import * as faceapi from 'face-api.js';

class FaceDetectionProcessor extends VideoProcessor {
  async processFrame(input, output) {
    const ctx = output.getContext('2d');

    // Draw original frame
    ctx.drawImage(input, 0, 0);

    // Detect faces
    const detections = await faceapi.detectAllFaces(input);

    // Draw bounding boxes
    detections.forEach(detection => {
      const box = detection.box;
      ctx.strokeStyle = '#00ff00';
      ctx.lineWidth = 2;
      ctx.strokeRect(box.x, box.y, box.width, box.height);
    });

    return true;
  }
}
Use Cases
Use CaseDescription
Face detectionBounding boxes, landmarks
AR effectsGlasses, hats, masks
Beauty filtersSkin smoothing, color correction
OverlaysText, logos, watermarks
Real-time translationOCR + translation overlay
Resources

Video Rendering (CRITICAL - Event Driven)

The SDK is event-driven. You must listen for events and render/detach videos accordingly.

Use attachVideo() NOT renderVideo()

renderVideo() is deprecated. Use attachVideo() which returns a VideoPlayer element to append to DOM.

import { VideoQuality } from '@zoom/videosdk';

const stream = client.getMediaStream();

// Start your camera
await stream.startVideo();

// Attach video - returns a VideoPlayer element
const videoElement = await stream.attachVideo(userId, VideoQuality.Video_360P);

// Append to your container
document.getElementById('video-container').appendChild(videoElement);
VideoQuality Enum
import { VideoQuality } from '@zoom/videosdk';

VideoQuality.Video_90P   // 0
VideoQuality.Video_180P  // 1
VideoQuality.Video_360P  // 2 (recommended for most cases)
VideoQuality.Video_720P  // 3
VideoQuality.Video_1080P // 4
Detach Video
// Detach and remove from DOM
const elements = await stream.detachVideo(userId);
if (Array.isArray(elements)) {
  elements.forEach(e => e.remove());
} else {
  elements.remove();
}
Required Events to Listen

You MUST listen to these events to properly render participant videos:

// When another participant's video state changes
client.on('peer-video-state-change', async (payload) => {
  const { action, userId } = payload;

  if (action === 'Start') {
    // Participant turned on video - attach it
    const element = await stream.attachVideo(userId, VideoQuality.Video_360P);
    container.appendChild(element);
  } else if (action === 'Stop') {
    // Participant turned off video - detach it
    await stream.detachVideo(userId);
  }
});

// When participants join/leave
client.on('user-added', (payload) => {
  // New participant joined - check if their video is on
  const users = client.getAllUser();
  // Render videos for users with bVideoOn === true
});

client.on('user-removed', (payload) => {
  // Participant left - clean up their video element
  const { userId } = payload;
  stream.detachVideo(userId);
});

// Participant state updates (mute, video, etc)
client.on('user-updated', (payload) => {
  // Re-check participant states
  const users = client.getAllUser();
});
Participant Properties
const users = client.getAllUser();

users.forEach(user => {
  user.userId      // Unique user ID
  user.displayName // User's display name
  user.bVideoOn    // Boolean - is video enabled?
  user.muted       // Boolean - is audio muted?
  user.audio       // '' | 'computer' | 'phone'
});
Complete React Pattern
// When your video turns on
useEffect(() => {
  if (isVideoOn && stream && currentUserId) {
    const attach = async () => {
      const element = await stream.attachVideo(currentUserId, VideoQuality.Video_360P);
      containerRef.current?.appendChild(element);
    };
    attach();
  }
}, [isVideoOn, stream, currentUserId]);

// Listen for other participants
useEffect(() => {
  if (!client) return;

  const handleVideoChange = async (payload) => {
    const { action, userId } = payload;
    if (action === 'Start') {
      const element = await stream.attachVideo(userId, VideoQuality.Video_360P);
      // Append to appropriate container
    } else {
      await stream.detachVideo(userId);
    }
  };

  client.on('peer-video-state-change', handleVideoChange);
  return () => client.off('peer-video-state-change', handleVideoChange);
}, [client, stream]);
Legacy: renderVideo (Deprecated)

Note: renderVideo() is deprecated. Use attachVideo() instead.

If you must use canvas rendering:

Canvas Must Exist in DOM
// CORRECT: Canvas exists before rendering
const canvas = document.getElementById('my-canvas');  // Already in DOM
await stream.renderVideo(canvas, userId, 640, 360, 0, 0, 3);

// WRONG: Creating canvas but not adding to DOM
const canvas = document.createElement('canvas');
await stream.renderVideo(canvas, userId);  // Won't display!
Use Single Rendering Control (IMPORTANT)

For performance, use ONE shared rendering control for all video streams, NOT one control per video.

// CORRECT: Single video container for all participants
const videoContainer = document.getElementById('video-container');
const stream = client.getMediaStream();

// Render all participants to the same container
await stream.renderVideo(videoContainer, userId, width, height, x, y, quality);
// WRONG: Creating separate controls per participant
// This degrades performance significantly!
participants.forEach(p => {
  const container = document.createElement('div');  // DON'T do this
  stream.renderVideo(container, p.id, ...);
});

Why:

  • Multiple rendering controls consume excessive resources

  • Performance degrades significantly with more participants

  • Single control handles internal layout management efficiently

Peer Video on Mid-Session Join (IMPORTANT)

Existing participants' videos won't auto-render when you join mid-session.

You must manually iterate all users and attach their video:

import { VideoQuality } from '@zoom/videosdk';

// After joining, render existing participants' videos
const renderExistingVideos = async () => {
  await new Promise(resolve => setTimeout(resolve, 500));

  const stream = client.getMediaStream();
  const users = client.getAllUser();
  const currentUserId = client.getCurrentUserInfo().userId;

  for (const user of users) {
    if (user.bVideoOn && user.userId !== currentUserId) {
      const element = await stream.attachVideo(user.userId, VideoQuality.Video_360P);
      document.getElementById(`video-${user.userId}`).appendChild(element);
    }
  }
};

Key points:

  • Check user.bVideoOn to see if video is enabled

  • Skip self (client.getCurrentUserInfo().userId)

  • Add ~500ms delay after join before rendering

  • Use attachVideo() not renderVideo()

SharedArrayBuffer

For optimal performance, configure these headers on your server:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

Note: As of v1.11.2, SharedArrayBuffer is elective (not strictly required).

Event Handling (CRITICAL)

The SDK is event-driven. You MUST listen for these events:

// Participant joined
client.on('user-added', (payload) => {
  console.log('User joined:', payload);
  // payload contains user info
});

// Participant left
client.on('user-removed', (payload) => {
  console.log('User left:', payload);
  // Clean up their video element
  stream.detachVideo(payload.userId);
});

// Participant state changed (mute, video, etc)
client.on('user-updated', (payload) => {
  console.log('User updated:', payload);
});

// CRITICAL: Other participant's video turned on/off
client.on('peer-video-state-change', async (payload) => {
  const { action, userId } = payload;
  // action: 'Start' | 'Stop'

  if (action === 'Start') {
    const element = await stream.attachVideo(userId, VideoQuality.Video_360P);
    // Append element to container
  } else {
    await stream.detachVideo(userId);
  }
});

// Connection state changed
client.on('connection-change', (payload) => {
  // payload.state: 'Connected' | 'Closed' | 'Reconnecting' | etc
});
Event Cleanup

Always remove listeners when component unmounts:

// React pattern
useEffect(() => {
  const handler = (payload) => { /* ... */ };
  client.on('peer-video-state-change', handler);

  return () => {
    client.off('peer-video-state-change', handler);
  };
}, [client]);

Common Tasks

Start/Stop Video
await stream.startVideo();
await stream.stopVideo();
Start/Stop Audio
await stream.startAudio();
await stream.muteAudio();
await stream.unmuteAudio();
Screen Sharing
Receive Screen Share

Listen to active-share-change event and render when active:

client.on('active-share-change', async (payload) => {
  const stream = client.getMediaStream();

  if (payload.state === 'Active') {
    // Add small delay to ensure DOM element exists
    await new Promise(resolve => setTimeout(resolve, 100));

    // Check if should use video element or canvas
    if (stream.isStartShareScreenWithVideoElement()) {
      const video = document.getElementById('share-video');
      await stream.startShareView(video as unknown as HTMLCanvasElement, payload.userId);
    } else {
      const canvas = document.getElementById('share-canvas');
      await stream.startShareView(canvas, payload.userId);
    }
  } else if (payload.state === 'Inactive') {
    await stream.stopShareView();
  }
});
Send Screen Share

Check rendering mode before starting:

const stream = client.getMediaStream();

// Check which element type to use
if (stream.isStartShareScreenWithVideoElement()) {
  // Use video element
  const video = document.getElementById('share-video');
  await stream.startShareScreen(video as unknown as HTMLCanvasElement);
} else {
  // Use canvas element
  const canvas = document.getElementById('share-canvas');
  await stream.startShareScreen(canvas);
}
Stop Screen Share
await stream.stopShareScreen();
Type Casting Workaround

SDK types expect HTMLCanvasElement even for video elements. Cast when needed:

// When using HTMLVideoElement where SDK expects HTMLCanvasElement
const video = document.getElementById('share-video') as HTMLVideoElement;
await stream.startShareView(video as unknown as HTMLCanvasElement, userId);

Host vs Participant

// Leave session (others stay)
await client.leave();

// End session for ALL participants (host only)
await client.leave(true);

Chat Implementation

Initialize Chat
const chatClient = client.getChatClient();

// Wait for chat to be ready
chatClient.on('chat-on', () => {
  console.log('Chat is ready');
});
Send Message
// Send to everyone
await chatClient.send('Hello, everyone!');

// Send to specific user
await chatClient.sendToUser(userId, 'Private message');
Receive Messages
chatClient.on('chat-on-message', (payload) => {
  const { message, sender, timestamp } = payload;
  console.log(`${sender.name}: ${message}`);
});

Error Handling

Common Join Errors
ErrorCauseSolution
Invalid signatureJWT expired or malformedGenerate new signature
Session does not existHost hasn't started yetShow "waiting" message, retry
Permission deniedUser denied camera/micRequest permission again
Example Error Handler
try {
  await client.join(topic, signature, userName, password);
} catch (error) {
  if (error.reason?.includes('signature')) {
    // Regenerate signature and retry
  } else if (error.reason?.includes('Session')) {
    // Show "Waiting for host..." and poll
  } else if (error.reason?.includes('Permission')) {
    // Guide user to enable permissions
  }
  console.error('Join failed:', error);
}

Recording (Host Only)

Only the host (role=1) can start/stop recording:

const recordingClient = client.getRecordingClient();

// Start cloud recording
await recordingClient.startCloudRecording();

// Stop recording
await recordingClient.stopCloudRecording();

// Listen for recording status changes
client.on('recording-change', (payload) => {
  console.log('Recording status:', payload.status);
});

Live Transcription

const transcriptionClient = client.getLiveTranscriptionClient();

// Start live transcription
await transcriptionClient.startLiveTranscription();

// Stop live transcription
await transcriptionClient.stopLiveTranscription();

// Listen for captions
client.on('caption-message', (payload) => {
  console.log(`${payload.displayName}: ${payload.text}`);
});

Device Selection

// Get available devices
const devices = await ZoomVideo.getDevices();
console.log('Cameras:', devices.cameras);
console.log('Microphones:', devices.microphones);
console.log('Speakers:', devices.speakers);

// Get currently active devices
const stream = client.getMediaStream();
const activeCamera = stream.getActiveCamera();
const activeMic = stream.getActiveMicrophone();
const activeSpeaker = stream.getActiveSpeaker();

// Switch devices
await stream.switchCamera(deviceId);
await stream.switchMicrophone(deviceId);
await stream.switchSpeaker(deviceId);

Network Quality

Monitor network quality in real-time:

client.on('network-quality-change', (payload) => {
  // payload.type = 'uplink' or 'downlink'
  // payload.level = 0-5 (5 is best)

  if (payload.level < 2) {
    console.warn(`Poor ${payload.type} network quality: ${payload.level}`);
  }
});

File Sharing

const chatClient = client.getChatClient();

// Send file to everyone (receiverId = 0)
await chatClient.sendFile(file, 0);

// Send file to specific user
await chatClient.sendFile(file, userId);

Breakout Rooms (Subsessions)

Video SDK uses "Subsessions" instead of native breakout rooms:

const subsessionClient = client.getSubsessionClient();

// Create subsessions
const roomNames = ['Room 1', 'Room 2', 'Room 3'];
await subsessionClient.createSubsessions(roomNames);

// Open subsessions
const rooms = subsessionClient.getSubsessionList();
await subsessionClient.openSubsessions(rooms);

// Broadcast message to all rooms
await subsessionClient.broadcast('Please return to main session in 5 minutes');

// Close all subsessions
await subsessionClient.closeAllSubsessions();

Reactions via Command Channel

Use the command channel for custom messages like reactions:

const commandClient = client.getCommandClient();

// Send reaction
const reaction = { type: 'reaction', emoji: '👍' };
await commandClient.send(JSON.stringify(reaction));

// Receive reactions
client.on('command-channel-message', (payload) => {
  try {
    const data = JSON.parse(payload.text);
    if (data.type === 'reaction') {
      console.log(`${payload.senderName} reacted with ${data.emoji}`);
    }
  } catch (e) {
    console.log('Non-JSON message:', payload.text);
  }
});

CORS Errors (Telemetry)

CORS errors to log-external-gateway.zoom.us are harmless.

These are caused by COOP/COEP headers blocking telemetry requests. They don't affect SDK functionality.

// These console errors can be safely ignored:
// Access to fetch at 'https://log-external-gateway.zoom.us/...' has been blocked by CORS policy

Resources

Host Participant Management

const stream = client.getMediaStream();

// Mute all participants
await stream.muteAllAudio();

// Mute/unmute specific participant
await stream.muteAudio(userId);
await stream.unmuteAudio(userId);

// Remove participant (host only)
await client.removeUser(userId);

// Transfer host
await client.makeHost(userId);

// Make co-host
await client.makeManager(userId);

Mirror Self View

const stream = client.getMediaStream();

// Toggle mirror (useful for self-view)
await stream.mirrorVideo(true);   // Enable mirror
await stream.mirrorVideo(false);  // Disable mirror

Share Screen with Audio

const stream = client.getMediaStream();
const shareElement = document.getElementById('share-element');

// Share with system audio
await stream.startShareScreen(shareElement, {
  secondaryAudio: true
});

Troubleshooting

"ZoomVideo is not defined" / "WebVideoSDK is not defined"

Causes:

  1. Ad blocker blocking source.zoom.us CDN

  2. ES module loading before SDK script

Solutions:

  1. Allowlist source.zoom.us in your environment, or use a permitted fallback (mirror/self-host) if you can keep versions in sync

  2. Use waitForSDK() function for ES modules

Camera/Microphone Not Working

Causes:

  1. Browser permission denied

  2. Device in use by another app

  3. No hardware available

Solutions:

  1. Check browser permissions (Settings → Privacy → Camera/Microphone)

  2. Close other apps using the device

  3. Try different browser

Video Not Displaying (Silent Failure)

Cause: Called getMediaStream() before join() completed

Solution: Follow the SDK lifecycle order exactly (see SDK Lifecycle section)

CORS Error on Signature Endpoint

Cause: Frontend (HTTPS) calling backend (HTTP) or different origin

Solutions:

  1. Use nginx proxy to same origin (recommended)

  2. Configure CORS on backend with explicit origins

  3. Ensure both frontend and backend use HTTPS

Browser Compatibility
FeatureChromeFirefoxSafariEdge
Video✅ 80+✅ 75+✅ 14+✅ 80+
Audio✅ 80+✅ 75+✅ 14+✅ 80+
Screen Share✅ 80+✅ 75+⚠️ 15+✅ 80+
Virtual BG✅ 80+✅ 90+❌✅ 80+

Safari Notes:

  • Virtual background not supported

  • Screen sharing requires macOS 15+

Requirements and compatibility

Written for: OpenAI Codex

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs network access, Needs Node.js

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Zoom
Publisher
OpenAI (Official)
Distributed by
OpenAI
Source
openai/plugins · plugins/zoom/skills/video-sdk/web · commit d420d13
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from plugins/zoom/LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Zoom or OpenAI.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download zoom-video-sdk-web.zip