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 create an application, enter your Application name and click Next.
- Get the SDKAppID and Secret key.
Configuring SDKAppID
and Secretkey
Open base-js/js/debug/GenerateTestUserSig.js
and paste the SDKAppID
and Secretkey
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 TRTC_Web/base-js
, 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 quick demo, 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