# HD Video Resolution Achieve 720p and 1080p video quality in Zoom Web SDKs, including viewport size requirements that affect resolution. ## Overview HD video quality in Zoom SDKs depends on multiple factors: container/viewport size, network bandwidth, SharedArrayBuffer support, and concurrent stream limits. **Video automatically scales down if the container is smaller than required dimensions.** ## Skills Needed - **zoom-meeting-sdk** (Web) - **zoom-video-sdk** (Web) ## Viewport Size Requirements **Critical:** Video resolution is automatically adjusted based on the rendered container size. ### Resolution Thresholds | Target Resolution | Minimum Container Size | Bandwidth Required | |-------------------|------------------------|-------------------| | **360p** | 480 × 270 | 600 kbps | | **720p** | 1280 × 720 (or 720 × 411 gallery) | 1.2-1.5 Mbps | | **1080p** | 1920 × 1080 | 2.5-3.0 Mbps | **If your video container is smaller than 1280×720, you will NOT get 720p video - it will automatically scale down.** ### Meeting SDK Component View Constraints | View Type | Minimum | Maximum | Aspect Ratio | |-----------|---------|---------|--------------| | **Speaker** | 240 × 135 | 1440 × 810 | 16:9 | | **Gallery** | 720 × 411 | 1440 × 720 | 16:9 | | **Ribbon** | 240 × 135 | 316 × 720 | Variable | ### Recommended Sizes for HD ```javascript // For 720p in speaker view const speakerContainer = { width: 1280, height: 720 }; // For 720p in gallery view (minimum) const galleryContainer = { width: 720, height: 411 }; // For 1080p (speaker view only) const fullHDContainer = { width: 1920, height: 1080 }; ``` ## Concurrent Stream Limits **Video SDK enforces strict concurrent HD limits:** | Resolution | Concurrent Limit | Notes | |------------|------------------|-------| | **720p** | **Max 2 streams** | Attempting 3rd results in `Errors_Wrong_Usage` | | **1080p** | **Only 1 stream** | Only one 1080p video can be rendered at a time | ### Recommended Quality by View | View Type | Active Speaker | Other Participants | |-----------|----------------|-------------------| | **Speaker View** | 720p or 1080p | 180p | | **Gallery (3×3)** | 360p all | 360p | | **Gallery (5×5)** | 180p all | 180p | | **Small thumbnails** | 180p | 180p | ## SharedArrayBuffer (SAB) Requirement ### Features Requiring SAB | Feature | SAB Required | |---------|--------------| | **Sending 720p video** | ✅ Yes | | **Virtual Background** | ✅ Yes | | **Gallery view (multiple videos)** | ✅ Yes | | **Background noise suppression** | ✅ Yes | ### Enabling SharedArrayBuffer Requires Cross-Origin Isolation headers on your server: ``` Cross-Origin-Opener-Policy: same-origin Cross-Origin-Embedder-Policy: require-corp ``` **Express.js example:** ```javascript app.use((req, res, next) => { res.setHeader('Cross-Origin-Opener-Policy', 'same-origin'); res.setHeader('Cross-Origin-Embedder-Policy', 'require-corp'); next(); }); ``` **Nginx example:** ```nginx add_header Cross-Origin-Opener-Policy same-origin; add_header Cross-Origin-Embedder-Policy require-corp; ``` ### Browser Support for SAB | Browser | Minimum Version | |---------|-----------------| | Chrome | 68+ | | Edge | 79+ | | Firefox | 79+ | | Safari | 15.2+ (macOS), iOS 15.2+ | | Opera | 73+ | **Note:** Safari requires newer versions and may have limitations. ### Impact of Missing SAB Without SharedArrayBuffer: - Max sending resolution: **360p** - No virtual background - Limited to single video rendering - No background noise suppression ## Video SDK Configuration ### Enable HD Video Capture ```javascript // Start video with HD enabled await stream.startVideo({ hd: true, // Enable 720p fullHd: true, // Enable 1080p (if supported) captureWidth: 1280, captureHeight: 720 }); ``` ### Subscribe to Specific Quality ```javascript // VideoQuality enum values: // Video_90P = 0 // Video_180P = 1 // Video_360P = 2 // Video_720P = 3 // Video_1080P = 4 // Attach video at specific quality await stream.attachVideo(userId, VideoQuality.Video_720P); // Or with renderVideo await stream.renderVideo(canvas, userId, 1280, 720, 0, 0, VideoQuality.Video_720P); ``` ### Check Device Capabilities ```javascript // Check if device supports HD const capabilities = await stream.getVideoCapabilities(); console.log('Max resolution:', capabilities.maxResolution); console.log('HD supported:', capabilities.hdSupported); ``` ## Meeting SDK Configuration ### Component View HD ```javascript ZoomMtg.init({ leaveUrl: 'https://your-site.com', disablePreview: false, videoResolution: '720p', // or '1080p' success: () => { console.log('Init success'); } }); ``` ### Responsive Container Setup ```html