Have a try @ https://webdemo.agora.io/agora_webrtc_troubleshooting/
Use this sample app to check if the following item works for Agora WebRTC before starting a call.
- Browser Compatibility
- Microphone
- Speaker
- Resolution
- Connection
- Camera (optional)
Ensure you have an Agora developer account and an App ID before using this app, see Agora Account for details.
-
Fill your App ID in the
settings.jsfile under ./src/utils. -
Install dependencies:
npm install -
To run the app locally:
npm run devVisit
localhost:8080on your browser. -
Build the app for production:
npm run buildBuilt files need to be served over an HTTP server.
The following introduces which APIs are used in each step of the precall test.
Use AgoraRTC.checkSystemRequirements to check if the browser is supported by Agora Web SDK.
/** whether your browser fully supports Agora Web SDK */
AgoraRTC.checkSystemRequirements(): boolean
/**
* some browser info got from
* object `navigator` in BOM
*/
navigator.appVersion
navigator.appName- Use
AgoraRTC.createStreamto create an audio stream. - Use
stream.getAudioLevelto retrieve the current volume.
/** create an audio stream and try to init/play it */
AgoraRTC.createStream(): stream
/**
* accumulate audio level to check
* if it is in an ideal range
*/
stream.getAudioLevel(): numberUse the audio element in HTML5 and let the users confirm whether they hear the sound.
- Use
AgoraRTC.createStreamto create video streams with different video profiles. - Use
HTMLVideoElementto get the video resolution.
/** Create stream with different video profiles */
AgoraRTC.createStream(): stream
/** Get actual resolution from html element */
HTMLVideoElement.videoHeight
HTMLVideoElement.videoWidth- Use
AgoraRTC.createClientto create a sender client and a receiver client. - Use
AgoraRTC.createStreamto create a stream. - Use
client.publishto publish the stream from the sender client. - Use
client.subscribeto subscribe the published stream to the receiver client. - Use
stream.getStatsto get the connection status of the Agora Web SDK.
/**
* Create two clients: a sender which will publish
* a regular stream, and a receiver which will subscribe the
* stream published by the sender.
*/
AgoraRTC.createStream(): stream
/** Get stream tranfer info by using getStats */
stream.getStats(callback: (stats:any) => void): voidCreate a stream and play it, then let the users check if the video frame displays properly.
See the App.vue file under ./src for the complete code.
The following lists the major APIs used by this sample app:
- AgoraRTC.createClient
- client.init
- client.join
- AgoraRTC.createStream
- stream.init
- stream.setVideoProfile
- client.publish
- client.subscribe
- stream.play
- stream.getStats
For full details of the APIs, see Agora Web API Reference.
MIT