Demo of Agora Voice Call.
The Real-Time Engagement Platform for meaningful human connections.
Most of code are in public/main.js
. Find main()
there.
Check out the official documentation.
- Clone or download this repo, and
npm ci
- Set up your Agora account with a project (app) for free
- Copy
public/secrets.example.js
intopublic/secrets.js
, and fill it - OK then
npm run start
You can temporarily share your localhost over ngrok to the internet.
- Set up and
npm run start
- Open another terminal (most likely
Ctrl+T
-ish) npm run serve:proxy
- Share the HTTPS URL to your fiends
Please make sure you share HTTPS URL. It does not work over HTTP protocol.
AgoraRTCError NOT_SUPPORTED: enumerateDevices() not supported.
AgoraRTCError WEB_SECURITY_RESTRICT: Your context is limited by web security, please try using https protocol or localhost.
→ Run on localhost
, or on https://
. This happens when it's on http://
.
AgoraRTCException AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic use static key
→ Set token
. Document says it's like optional, but you need it actually.
AgoraRTCError INVALID_PARAMS: Invalid token: . If you don not use token, set it to null
→ Set token
in your secrets.js
. It should be left empty.
Choose server https://webrtc2-ap-web-1.agora.io/api/v1 failed, message: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic key expired, retry: false
→ Renew token
. Expired. About 24 hours?
AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: invalid token, authorized failed
→ Make sure the token
is generated with exactly your channel name
Here you go:
- Project Management > Edit > Features > Generate temp token
Or follow the document: Generate a Token
AgoraRTCError INVALID_OPERATION: Can't publish stream, haven't joined yet!
→ Invoke client.join()
first.
TypeError: Cannot read property 'remove' of null
→ Check if the element exists.
The document describes to delete an element which is the result of document.getElementById(user.uid)
, but I didn't find where the element is created.