Tutorial: Demo Quick Run

Demo Quick Run

This document describes how to quickly run the demo of the TRTC SDK for web.

Downloading Demo Source Code

Download the source package of the TRTC SDK at GitHub. You can find the demo source code in TRTC_Web/base-js.

Creating Application in Console

  • Log in to the TRTC console, create an application, and get its SDKAppID.

  • Click Quick Start to view and copy the key.

Configuring SDKAppID and userSig

Open TRTCSDK/Web/js/debug/GenerateTestUserSig.js and paste the SDKAppID and userSig obtained.

Setting Up Web Server

Please use the HTTPS protocol or localhost.

  • Install http-server.
 npm install http-server -g
  • Start the web server.

In TRTCSDK/Web, run the command below.

http-server -p 8080 base-js

Running Demo

Use the latest version of Chrome or Safari to open the URL below.

localhost:8080/index.html
  • Click Join to join a room and publish the local stream.
  • Click Leave to leave a call.
  • Click Publish to publish the local stream.
  • Click Unpublish to unpublish the local stream.

Experience TRTC Demo

To make the experience easier, TRTC provides a Web quick example, under this page, enter your application's SDKAppId, SecretKey. Enter the same RoomID, you could join the same room and make a video/audio call.

Firewall Configuration

The TRTC SDK for web uses the following ports and domain for data transfer, which should be added to the allowlist of your firewall.

  • TCP port: 8687
  • UDP ports: 8000, 8800, 843, 443
  • Domain name: qcloud.rtc.qq.com