Integrating Zoom Video SDK on Windows with WPF, Win32, and WinForms
Zoom Video SDK allows you to create fully customized video call experiences on desktop, mobile, and in web browsers. Today, let’s talk about the Windows side of things, specifically how to work with the C++ SDK and the specialized renderer.
Windows UI Frameworks and the Video SDK
The Zoom Video SDK for Windows is natively C++. This means if you’re using UI libraries that play nice with C++ (like duilib, GTK, or Qt), you’re in for an easy ride.
However, if you’re exploring Microsoft-centric UI libraries like Windows Forms, WPF, or WinUI, you’ll need to wrap the C++ libraries before you can call them from C#. It’s an extra step, but definitely doable. I’ve actually put together a quickstart for .NET Desktop Framework that you can check out here: videosdk-windows-dotnet-desktop-framework-quickstart.
The Application Lifecycle
When working with the Video SDK, you’re essentially managing three phases:
- Pre-session prep work
- In-session
- Post-session
The Singleton Object
The SDK is provided as a singleton. You’ll create a single instance of the ZoomVideoSDK object, and your entire application lifecycle will revolve around it.
Signature and Sessions: Just-in-Time Calls
One of the coolest things about the Video SDK is that calls aren’t scheduled—they’re created on-demand. If Bob and Alice want to chat tomorrow at noon, they just need to join with the same unique session name (e.g., “Lunch time talk 39271582”) and password. Zoom creates the session just-in-time.
These details are stored in a JWT signature (token), which identifies the participant’s role (host vs. participant). Here’s a quick reference for the payload:
| Key | Necessity | Value |
|---|---|---|
app_key |
Required | Your Video SDK key. |
role_type |
Required | 1 for host/co-host, 0 for participant. |
tpc |
Required | Session name (max 200 chars, case-insensitive). |
version |
Required | Set to 1. |
iat / exp |
Required | Issue and expiration timestamps (Epoch). |
Pre-session Prep Work
Before you jump into a call, you need to handle the basics:
- Devices: Use the singleton object to detect and set the camera, microphone, and speakers.
- Context: Use
ZoomVideoSDKSessionContextto customize your entry (e.g., joining with video off or audio muted).
The Specialized Video Renderer
On Windows, Zoom provides a specialized renderer for efficient display. This is separate from the core SDK and needs its own setup.
1. Initialization:
VideoSDKRenderInitParam init_param;
init_param.frame_rate = 30;
init_param.renderer_type = VideoSDKRendererType_D3D11; // DirectX 11 for the win
VideoSDKRenderInitErrorType error = InitZoomVideoSDKRendererModule(init_param);
2. Creating the Renderer:
IZoomVideoSDKRenderer* renderer = CreateZoomVideoSDKRendererObj();
if (renderer) {
renderer->SetParentHandle((void*)your_window_handle);
renderer->SetVideoItemBkColor(RendererColor(58, 59, 59));
}
The renderer handles everything from GPU acceleration to multiple video streams and layout management. Just remember to clean up with DestroyZoomVideoSDKRendererObj and CleaupZoomVideoSDKRendererModule when you’re done.
In-session: Working with Users
- Self-Video: Use the Video Preview method for your own feed. It’s faster and avoids unnecessary network roundtrips.
- Remote Participants: Subscribe to their video via the video pipe, which you can get from the user object in the
onUserJoincallback. - Status Checks: Always check if a user’s video is actually on before trying to render it:
pUSerInfo->getVideoPipe()->getVideoStatus().isOn
Muting and Unmuting
Toggling audio and video is a common task. Here’s a quick look at how you might handle an audio mute toggle:
void on_mute_audio_clicked()
{
if (video_sdk_obj && g_in_session)
{
IZoomVideoSDKAudioHelper* audioHelper = video_sdk_obj->getAudioHelper();
IZoomVideoSDKSession* m_sessionhelper = video_sdk_obj->getSessionInfo();
if (audioHelper && m_sessionhelper)
{
IZoomVideoSDKUser* currentUser = m_sessionhelper->getMyself();
if (currentUser)
{
if (g_audio_muted)
audioHelper->unMuteAudio(currentUser);
else
audioHelper->muteAudio(currentUser);
g_audio_muted = !g_audio_muted;
updateButtonStates();
}
}
}
}
Conclusion
Integrating the Zoom Video SDK on Windows gives you a lot of power, especially with the hardware-accelerated renderer. Once you’ve got the basics down, you can start adding advanced features like screen sharing, cloud recording, and live transcriptions.
Want to dive deeper? Check out the official Zoom Video SDK for Windows documentation.
Happy coding! 🚀 #WindowsDev #Zoom #VideoSDK #Cpp #DirectX