Skip to content
Run Video Chat within your Unity application (Windows) Featured

Run Video Chat within your Unity application (Windows)

By Author: Jake Priddy In Developer

Being able to communicate with across mobile platforms is great but when you add the ability to connect to the Windows platform you begin to open a whole new world of possibilities. With our Agora Video SDK for Unity3D you can add cross-platform functionality to Windows, Mac, Android, and iOS. Follow along and I will show you how to get video communication up and running in no time on your Windows device.

Getting a sample Windows app up and running is simple and took less than 10 minutes. Let’s run through the steps together.


Getting Started

To start, open Unity and create a blank new project named Agora Video Demo.

The next step is to navigate to the Unity Store (if you are in the scene view, click the Unity Store tab) and search for “Agora Video SDK”. Once the plugin page has loaded, go ahead and click Download. Once the plugin page has loaded, go ahead and click Download. Once the download is complete, click and Import the assets into your project.

Update Code

Great! Now that we have the plugin downloaded and imported to our project we need to make one quick update before we can build and run our app. First, we need to log into our Agora developer account and create a new AppID or select an existing one. Then in your Editor>Hierarchy select your GameController and the go into the Inspector Panel add your App ID into the App ID field of the Test Home Script Component.

You will need to change the App ID to a new one you create on the Agora website. Don’t worry about charges during early development, they give you the first 10,000 minutes free every month

Make sure to save your changes.

We can scroll through the TestHelloUnityVideo.cs file to see all the various event callbacks the Agora Voice SDK for Unity offers.

Set Plugin Identities

Because the Agora Video chat app has cross-functionality with Android, iOS, Mac, and Windows we will set the plugin identities. You will need to also choose between x86 and x86_64 and set the identities accordingly. Here I will go into Assets>Plugins>x86 folder and select only Standalone so I can run it on my Windows device and then hit Apply.

Here I choose x86 as my Architecture

So that the plugins don’t collide we will then need to go into Assets>Plugins>x86_64 and select all the files. Then go into the Inspector and uncheck everything and hit apply.

Deselecting the x86_64 plugin will keep you from getting a collision error

Running the Sample Application

Open the Build Settings and drag the TestSceneHome.unity & TestSceneHelloVideo.unity scenes from the assets list into the “Scenes in Build” list. If it is not already selected, select PC, Mac & Linux from the Platform list and select Windows as the Target Platform. Since the Video SDK 2.9.0 update, x86 and x86_64 architectures are both supported. If necessary click Switch Platform.

Once Unity finishes its setup process, open the Player Settings. We will need to make sure our Windows app also has a unique package name, I chose com.agora.videodemo.

Then click Build And Run. Unity will prompt you to save your project, I create a folder for my builds named Builds and Create a folder inside of that named WindowsBuilds to hold my Windows builds, this will keep you from having issues in the future if you want to use the same project to run on Mac, iOS, or Android.

Other Resources: