Integrate SDK into your app
Zoom Video SDK for Unity is in a public beta. Share your feedback with us.
The Unity plugin for Video SDK is a wrapper for the Video SDK for Android and the Video SDK for macOS. The platform SDK files are not included in the wrapper. Therefore, you must download the same version of the Video SDK for Android, or Video SDK for macOS from the Zoom App Marketplace and copy the platform SDK files into the corresponding Unity Plugin directory.
Initialize the SDK
SDK Initialization is required before calling any other functions of the SDK. To initialize the SDK, create an instance of the ZMVideoSDKInitParams object and set the domain of the context to "zoom.us". Optionally, you may also enable logging for debugging purposes.
Note that you must call the Video SDK from the main thread.
ZMVideoSDKInitParams initParams = new ZMVideoSDKInitParams();
initParams.domain = "https://zoom.us";
initParams.enableLog = true;
ZMVideoSDK.Instance.Initialize(initParams, (result) => { });
Initialization fields
The following table describes each field in ZMVideoSDKInitParams.
| Field | Description |
|---|---|
audioRawDataMemoryMode | ZoomVideoSDKRawDataMemoryMode. Raw data buffer exists in heap or stack. |
domain | Required. String. The web domain. |
enableFullHD | Boolean. Only for Oculus devices. |
enableLog | Optional. Boolean. Enable log. |
extendParam | ZoomVideoSDKExtendParams. For the speaker test file path. |
logFilePrefix | String. Log file prefix. |
shareRawDataMemoryMode | ZoomVideoSDKRawDataMemoryMode. Raw data buffer exists in heap or stack. |
videoRawDataMemoryMode | ZoomVideoSDKRawDataMemoryMode. Raw data buffer exists in heap or stack. |
For more information on how to use the ZoomVideoSDKRawDataMemoryMode object, see Raw Data in the Video SDK for Android documentation.
Verify initialization
Zoom returns the initialization result from the Native SDK to the the Unity C# wrapper using the callback function. If the SDK initialization is not successful, see the SDK error code for details.
Initialize with debug log
You can enable the debug log feature when initializing the SDK with the following method:
ZMVideoSDKInitParams initParams = new ZMVideoSDKInitParams();
initParams.domain = "https://zoom.us";
initParams.enableLog = true;
ZMVideoSDK.Instance.Initialize(initParams, (result) => { });
Once you've initialized the log feature, the SDK creates an encrypted log file in the corresponding Native SDK log location.
Listen for callback events
The IZMVideoSDKDelegate allows you to subscribe to callback events that provide status updates on the operations performed in your app that are related to the Video SDK. For example, you might want to be notified when a user has successfully joined or left a session.
IZMVideoSDKDelegate ZMDelegate = new ZMVideoSDKDelegateImpl(this);
Add a listener
To subscribe to events, you must define your own instance of the ZMVideoSDKDelegate object and you must add it to the SDK by calling the AddListener function.
ZMVideoSDK.Instance.AddListener(ZMDelegate);
Remove a listener
To unsubscribe to events, call RemoveListener.
ZMVideoSDK.Instance.RemoveListener(ZMDelegate);