Integrate SDK into Your App

The Zoom Windows Video SDK allows you to add real-time voice, video and chat capabilities to your app.

Prerequisites

  • Visual Studio 2019 or later
  • Windows Desktop Application: "Desktop development with C++" workload
  • Windows version 10 or above
  • Valid SDK Credentials

Set up development environment

  1. Open your project in Visual Studio and select your solution.
  2. Set the Solution configuration to release. The SDK does not support debug builds.
  3. To ensure the annotation on the Windows shared view has the correct position, set the Windows DPI Awareness project property to Per Monitor High DPI Aware. See Setting the default DPI awareness for a process for Win32 apps for details.

Import the SDK library

Download the Video SDK by creating an SDK app on the Zoom Marketplace. The downloaded folder includes three folders:

  • bin — Includes videosdk.dll and its dependent Libraries.
  • h — SDK's external header files.
  • libvideosdk.lib

Navigate to Project -> "YourProjectName" Properties

  1. Select C/C++ -> General -> Additional Include Directories. Add the h folder.
  2. Select C/C++ -> General -> Debug Information Format. Set to "None".
  3. Select Linker -> General -> Additional Library Directories. Add the lib folder.
  4. Select Linker -> Input -> Additional Dependencies -> Add videosdk.lib.

Initialize the SDK

The SDK requires initialization before you can call any other functions. To initialize, create an instance of IZoomVideoSDK using CreateZoomVideoSDKObj().

Note that you must call the Video SDK from the main thread.

IZoomVideoSDK* m_pVideoSDK;
m_pVideoSDK = CreateZoomVideoSDKObj();

Create an instance of ZoomVideoSDKInitParams and specify the initialization parameters.

ZoomVideoSDKInitParams initParams;
// Set network domain
initParams.domain = L"https://zoom.us";
// Set raw data memory mode
initParams.audioRawDataMemoryMode = ZoomVideoSDKRawDataMemoryModeStack;
initParams.videoRawDataMemoryMode = ZoomVideoSDKRawDataMemoryModeStack;
initParams.shareRawDataMemoryMode = ZoomVideoSDKRawDataMemoryModeStack;
// Set to enable indirect raw data
initParams.enableIndirectRawdata = false;
// Set to enable SDK logging
initParams.enableLog = true;
// Set to specify the prefix of the log file name
initParams.logFilePrefix = L"prefix";

Call the initialize function on the IZoomVideoSDK object and pass in the ZoomVideoSDKInitParams object.

int returnVal = m_pVideoSDK->initialize(initParams);
if (returnVal != ZoomVideoSDKErrors_Success)
{
    // Call to initialize failed. Inspect returnVal to see error.
    return;
}

Once the SDK is successfully initialized, you will be able to call the SDK functions. You can set up a listener for events such as when a user joins a session or leaves a session.

Initialize with debug log

You can enable the debug log feature when initializing the SDK with the following method:

 ZoomVideoSDKInitParams init_params;
    init_params.domain = _T("https://go.zoom.us");
    init_params.enableLog = true;
    init_params.logFilePrefix = _T("zoom_win_video_demo");
    init_params.videoRawDataMemoryMode = ZoomVideoSDKRawDataMemoryModeHeap;
    init_params.shareRawDataMemoryMode = ZoomVideoSDKRawDataMemoryModeHeap;
    init_params.audioRawDataMemoryMode = ZoomVideoSDKRawDataMemoryModeHeap;
    init_params.enableIndirectRawdata = false;
    ZoomVideoSDKMgr::GetInst().Init(this, init_params);

Once you've initialized the log feature, the SDK creates an encrypted .log file at C:\Users\UserName\AppData\Roaming\ZoomSDK\logs

The log file has a 5MB fixed maximum storage capacity. Once it reaches the maximum capacity, it automatically re-records from the beginning and overrides the previous data.

Listen for callback events

IZoomVideoSDKDelegate allows you to subscribe to callback events that provide status updates on the operations performed in your app that are related to the SDK. For example, you may want to receive notifications when a user has successfully joined or left a session.

Implement a delegate

To subscribe to these events, you must have your class inherit from the IZoomVideoSDKDelegate interface.

This section will show you how to implement this delegate and assign it to the SDK instance and provide you with examples of the event handlers associated with the SDK.

Add instance of IZoomVideoSDKDelegate to IZoomVideoSDK instance

// CExampleListener.h
class CExampleListener: IZoomVideoSDKDelegate {
    // ...
private:
    IZoomVideoSDK* m_pVideoSDK;
    // ...
}
// CExampleListener.cpp
m_pVideoSDK->addListener(this);

Callback functions

The following examples show the various callback functions that are provided by the Video SDK. You can use these functions and implement any additional operations as needed after receiving the callback function result.

Get notified of operation results and SDK errors

void CExampleListener::onError(ZoomVideoSDKErrors errorCode, int detailErrorCode)
{
    CString info;
    switch(errorCode)
    {
    case ZoomVideoSDKErrors_Meeting_Disconnecting:
        info.Format(_T("onError(): Disconnecting from session, Error:%d DetailCode: %d"), errorCode, detailErrorCode);
        break;
    case ZoomVideoSDKErrors_Meeting_Reconnecting:
        info.Format(_T("onError(): Reconnecting to session, Error:%d DetailCode: %d"), errorCode, detailErrorCode);
        break;
    case ZoomVideoSDKErrors_Meeting_Join_Failed:
        info.Format(_T("onError(): Failed to join session, Error:%d DetailCode: %d"), errorCode, detailErrorCode);
        break;
    default:
        info.Format(_T("onError(): Error:%d DetailCode: %d"), errorCode, detailErrorCode);
        break;
    }
}

Add features

See details on features and other callback functions in the Add features sections for Video, Audio, and others.

See Error codes for a list of error codes, descriptions, and troubleshooting suggestions.