This document describes how to quickly run the TRTC demo for Electron.
TestTRTC, and click Create.
TRTCSDK/Electron/TRTCSimpleDemo/directory, which is the "project directory" mentioned below.
debug/gen-test-user-sig.jsfile in the project directory.
File paths and description:
bash . |---README.md README file. Please read it carefully. |---main.electron.js Electron main file |---public Stores static files |---babel.config.js |---package.json |---vue.config.js Vue CLI project file |---src Source code directory | |---app.vue | |---common.css | |---main.js | |---components UI component directory | | |---main-menu.vue | | |---nav-bar.vue | | |---show-screen-capture.vue | |---common Utility functions, public libraries, etc. | | |---live-room-service.js | | |---log.js Log tools | | |---mtah5.js | | |---routes.js | | |---rand.js | |---pages View directory | | |---index.vue Homepage | | |---trtc Video conferencing views | | | |---trtc-room.vue Video conferencing room view | | | |---trtc-index.vue Video conferencing entry view | | |---404.vue | | |---live Live streaming views | | | |---live-index.vue Live streaming entry view | | | |---live-room-audience.vue Viewer room view | | | |---live-room-anchor.vue Anchor room view | |---debug Note: when deploying your project, please move the signature logic in this folder to the server for implementation. | | |---lib-generate-test-usersig.min.js | | |---gen-test-user-sig.js
cmdto open Windows Command Prompt as Administrator, locate the project directory, and run the following command.
shell $ npm install
shell $ npm run start # During the first run, the UI will appear in the window after a while
Open a terminal window or Command Prompt and run the following command to install Homebrew. If you have already installed it, skip this step.
shell $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Run the following command to install Node.js.
shell $ brew install node
If it is too slow for you to install Node.js via Homebrew, consider using a mirror address in your country or region.
shell $ cd `brew --repo` $ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git $ brew update
cd command to go to the project directory and run the following command.
shell $ npm install
After the npm dependencies are installed, run the following command in Command Prompt to run the demo.
shell $ npm run start # On first run, it may take a while for the UI to appear.
|npm run start||Runs the demo in development environment.|
|npm run pack:mac||Packages the project into a DMG installer for macOS|
|npm run pack:win64||Packages the project into a 64-bit EXE installer for Windows|
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. Without upgrading, you can continue to use the old algorithm ECDSA-SHA256.
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.
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.