This document describes how to quickly run the TRTC demo for Windows.
Environment Requirements
Developing for Windows using C++
Microsoft Visual Studio (VS) 2015 or above (2015 is recommended)
TRTC SDK for Windows 8.0 or above (8.1 is recommended)
Developing for Windows using C#
VS 2015 or above (2017 is recommended)
.Net Framework 4.0 or above (4.0 is recommended)
Developing for Windows using Qt
VS 2015 or above (2015 is recommended)
Find the right version of Qt add-in for your VS on the official website, and download and install the VSIX file. Open VS, in the menu bar, select QT VS Tools > Qt Options > Qt Versions
, and add an MSVC compiler.
Copy all the DLL files in SDK/CPlusPlus/Win32/lib
to the debug
/release
folder of the project directory.
Note
The debug
/release
folder is created automatically after environment setup is completed in VS.
Prerequisites
You have signed up for a Tencent Cloud account. Directions
Step 1. Create an application
2. In the popup page, select RTC Engine, enter the application name, and then click Create.
3. After your application created, you can get your SDKAppID
and SDKSecretKey
on Basic informaction. SDKAppID
and SDKSecretKey
is needed for running demo.
Note
An application name can contain up to 15 characters. Only digits, letters, Chinese characters, and underscores are allowed.
Tags are used to identify and organize your Tencent Cloud resources. For example, an enterprise may have multiple business units, each of which has one or more TRTC applications. In this case, the enterprise can tag TRTC applications to mark out the unit information. Tags are optional and can be added or edited according to your actual business needs.
Step 2. Download the SDK and demo source code
1.You can download the sample code for Windows platform on github. 1. In the Modify Configuration step, select the development platform in line with the source package downloaded.
2. Find and open the GenerateTestUserSig
file:
|
Windows(C++) | TRTC-API-Example-C++/TRTC-API-Example-Qt/src/Util/defs.h |
Windows(C#) | TRTC-API-Example-CSharp/TRTC-API-Example-CSharp/GenerateTestUserSig.cs |
3. Set parameters in the GenerateTestUserSig.js
file:
SDKAPPID
: `0` by default. Set it to the actual `SDKAppID`.
SDKSECRETKEY
: left empty by default. Set it to the actual key.
notice
The method for generating UserSig
described in this document involves configuring SDKSECRETKEY
in client code. In this method, SDKSECRETKEY
may be easily decompiled and reversed, and if your key is leaked, attackers can steal your Tencent Cloud traffic. Therefore, this method is only suitable for the local execution and debugging of the demo.
The correct UserSig
distribution method is to integrate the calculation code of UserSig
into your server and provide an application-oriented API. When UserSig
is needed, your application can send a request to the business server for a dynamic UserSig
. For more information, please see How do I calculate UserSig on the server?. Step 4. Compile and run
Windows (C#):
Use VS (VS 2017 is recommended) to open TRTC-API-Example-CSharp.csproj
in the source code directory, and compile and run the demo project. We recommend building the project in the release mode for x86.
FAQs
1. Only public and private keys can be obtained when I try to view the key. How do I get a key?
TRTC SDK 6.6 (August 2019) and later versions use the new signature algorithm HMAC-SHA256. If your application was created before August 2019, you need to upgrade the signature algorithm to get a new key.
2. The demo is running on two devices, but why can't they display the images of each other?
Make sure that the two devices use different UserIDs
. With TRTC, you cannot use the same UserID
on two devices simultaneously unless the SDKAppIDs
are different.
3. What are firewall restrictions does the SDK face?
The SDK uses the UDP protocol for audio/video transmission and therefore cannot be used in office networks that block UDP. If you encounter such a problem, please see How to Deal with Firewall Restrictions.
Was this page helpful?