How zoom/meetingsdk-web works
Project Type and Purpose
• This is a frontend-focused JavaScript/TypeScript SDK packaged as an NPM library (@zoom/meetingsdk).
• It embeds Zoom Meeting/Webinar capabilities into a host web application via high-performance WebAssembly (WASM) modules.
• Provides two integration modes: Client View (full-page UI) and Component View (embeddable widgets).
High-Level Architecture Components
a. Host Web Application
– Your website or single‐page app that installs and calls into @zoom/meetingsdk.
b. Zoom Meeting SDK Library
– index.js / embedded.js: Entry points exposing ZoomMtg (Client View) and ZoomMtgEmbedded (Component View) APIs.
– Type declarations (index.d.ts, embedded.d.ts).
c. Static Assets (dist/)
– lib/
• audio/ → notification chimes (MP3 files).
• av/ → WebAssembly binaries & supporting JS for audio/video encode/decode, plus binary models (dualModel.bin, vbbuffer.bin) and TFJS WebAssembly backends.
• image/, lang/, vendor/ → locale JSON files, images, third-party assets.
– ui/
• CSS files (zoom-meetingsdk.css variants), cursor files, theming assets.
d. Runtime Components
– WebAssembly Modules
• Audio encoder/decoder, video decoder, network code compiled to .wasm
• Loaded via ZoomMtg.preLoadWasm() and ZoomMtg.prepareWebSDK()
– Web Workers
• vbPreloadWorker.js for preloading ML models & binaries off the main thread.
– DOM Overlays
• SDK will dynamically insert DOM elements (video canvases, controls, notifications).
e. Network & External Services
– Zoom Signaling & Media Servers
• REST/JSON API for meeting management (init/join).
• WebSocket or proprietary real-time signalling for audio/video negotiation.
– Zoom CDN
• Hosts WASM, CSS, audio assets (configured by assetPath or setZoomJSLib / webEndpoint for ZFG).
– Zoom REST API
• Signature (JWT) generation endpoint (your backend or Zoom Auth Sample).
• Optionally webhooks for meeting events (depends on application).
Interactions & Data Flow
1. Install & Import: host app does npm install and imports ZoomMtg or ZoomMtgEmbedded.
2. Initialization Phase:
– ZoomMtg.preLoadWasm(): fetch WASM binaries from dist/lib/av.
– ZoomMtg.prepareWebSDK(): load supporting JS, workers, models.
– ZoomMtg.init() / client.init(): configure leaveUrl, assetPath, language, patchJsMedia.
3. Join Phase:
– Host app calls join() with signature, meetingNumber, userCredentials.
– SDK does HTTPS request to Zoom REST API to authorize/join.
– On success, open WebSocket or WebRTC sessions to Zoom media servers.
4. Media Pipeline:
– Audio: microphone capture → audio.encode.wasm → send over network → remote audio.decode.wasm → Web Audio output.
– Video: remote video packets → video.decode.wasm → render to HTML5 <canvas> or <video> element.
– Business logic / events wired to SDK callbacks in host app.
5. UI Rendering:
– CSS from dist/ui/zoom-meetingsdk.css applied to DOM overlays.
– Locale JSON files loaded from dist/lib/lang for button labels, tooltips.
Architectural Patterns & Design Principles
• Modular Frontend Library: clearly separated entry points for Client vs Component view.
• Resource Preloading: WASM & ML models loaded ahead of time to minimize join latency.
• WebAssembly + Web Worker Offload: compute-intensive tasks run off main thread.
• Asset CDN Abstraction: assetPath/webEndpoint configuration allows switching between Zoom.com and ZoomGov endpoints.
• Pluggable UI: CSS variables + JS events let integrators customize look & feel.