This topic describes how to run the HarmonyOS demo.
Prerequisites
You have obtained authentication information from the console. For more information, see User Guide.
The token obtained from the console is for development and testing only. It is not secure for use in a production environment. For your production application, you must set up your own server to generate tokens over the HTTPS protocol. For more information, see Generate a token on the server-side.
Environment requirements
Type |
Description |
Terminal device |
A physical device running HarmonyOS. |
System version |
5.0.0 or later. |
Procedure
Download and decompress the software development kit (SDK) and the sample code. For more information, see SDK download.
In the `Demo/oh-package.json5` file, change `"@dingrtc/dingrtc": "3.5.0"` to the latest version.
Open the CommonConstants.ets file in `BasicVideoCall` and configure your authentication information.
static readonly APP_ID = ; // TODO: Your App ID static readonly TOKEN = ; // TODO: Your channel authentication token. For more information, see the README file.Run the demo.
After the demo runs successfully, enter a channel ID, user ID, and username on the main interface. Then, click the "Join Channel" button.
After you join the channel, a preview of your local video stream appears in the grid view.
When another user joins the same channel, the application automatically subscribes to their video and audio streams and displays their video in the grid view.