Zoom Video SDK allows you to create fully customized video call experiences on desktop, mobile, and in web browsers. Today, let’s take a look at how to integrate the Zoom Video SDK on Linux using UI frameworks like GTK and Qt.

Prerequisites

Before we dive in, make sure you have the following ready:

  • Your preferred code/text editor (I’m using VS Code, obviously).
  • A Linux Environment. I’m building this on Ubuntu, but it should be compatible with other distributions.
  • Video capture and sound playback devices.
  • A Zoom Video SDK Account. Note that headers and libraries aren’t included in the repo, so you’ll need to download them from marketplace.zoom.us.

Step 1: Clone the Scaffolding Project

Depending on your UI preference, clone either the Qt or GTK quickstart project from GitHub. I’ve actually got my own versions of these that you can use:

For GTK:

git clone https://github.com/tanchunsiong/videosdk-linux-gtk-quickstart

For Qt:

git clone https://github.com/tanchunsiong/videosdk-linux-qt-quickstart

Both projects are structured similarly, with the core code residing in the src folder.

Step 2: Populate the SDK Files

Download the C++ Video SDK for Linux from the Zoom Marketplace and place the files into their respective folders. Here’s a quick look at the folder structure for the x64 version:

├── src/                         # project folder
│   └── include/                 # json.hpp goes here
│       └── zoom_video_sdk/      # .h header files go here
│          └── helpers/          # .h helper header files go here
│    └── lib/                    # Static libraries
│           └──zoom_video_sdk/   # *.so files go here           
│                 └── qt_libs    # Qt folder goes here

Step 3: Configuration

Populate config.json with your session name, signature, password, and username. If you’re not sure how to generate a signature, check the Zoom documentation for the latest methods.

Step 4: Build the Project

Each project has its own set of dependencies listed in readme.md. Once you’ve installed them for your distribution, you can start the build process:

cd src
cmake -B build
cd build
make
cd ..
cd bin

Running the Executable: The binary names differ slightly between the two:

  • ./SkeletonDemo (for the GTK sample)
  • ./VideoSDKQTDemo (for the Qt sample)

Understanding the ZoomVideoSDK Object

The IZoomVideoSDK object is a singleton that you’ll use throughout the lifecycle of your video session. When it’s initialized, we attach event handlers to manage the call’s lifecycle.

Before joining, you can use the SDK to manage devices:

// Get/set camera, mic, and speaker devices
video_sdk_obj->getVideoHelper();
video_sdk_obj->getAudioHelper();

When joining, we use ZoomVideoSDKSessionContext to pass the necessary parameters:

ZoomVideoSDKSessionContext session_context;
session_context.sessionName = session_name.c_str();
session_context.sessionPassword = session_psw.c_str();
session_context.userName = "User Name";
session_context.token = session_token.c_str();

session_context.videoOption.localVideoOn = false;   // Start with video OFF
session_context.audioOption.connect = true;        // Connect audio
session_context.audioOption.mute = false;          // Start unmuted

// Join the session
IZoomVideoSDKSession* session = NULL;
if (video_sdk_obj)
    session = video_sdk_obj->joinSession(session_context);

Wait for the onSessionJoin callback to fire before proceeding.

Event Listeners

The Video SDK is event-driven. You’ll want to listen for:

  • Session Join: Triggered when you’re successfully in.
  • User Join & Leave: Fired when remote users enter or exit.
  • Audio & Video: Handled via custom implementations like g_preview_handler and g_remote_video_raw_handler.

Managing the Session

To leave the call, we call leaveSession:

void on_leave_session_clicked()
{
    if (video_sdk_obj && g_in_session)
    {
        video_sdk_obj->leaveSession(false);
        g_in_session = false;
        updateButtonStates();
        updateStatus("Left session");
    }
}

Mute and Video Controls

Toggling audio and video is straightforward using the helpers:

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

And that’s it! You’ve integrated video and audio conferencing into your Linux app. This is just the tip of the iceberg—you can add screen sharing, chat, cloud recording, and even live transcriptions. Check out the “Add Features” section in the Zoom Video SDK for Linux documentation for more.

Happy coding! 🚀 #Linux #Zoom #VideoSDK #Cpp