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.js
file under ./src/utils. -
Install dependencies:
npm install
-
To run the app locally:
npm run dev
Visit
localhost:8080
on your browser. -
Build the app for production:
npm run build
Built 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.createStream
to create an audio stream. - Use
stream.getAudioLevel
to 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(): number
Use the audio element in HTML5 and let the users confirm whether they hear the sound.
- Use
AgoraRTC.createStream
to create video streams with different video profiles. - Use
HTMLVideoElement
to 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.createClient
to create a sender client and a receiver client. - Use
AgoraRTC.createStream
to create a stream. - Use
client.publish
to publish the stream from the sender client. - Use
client.subscribe
to subscribe the published stream to the receiver client. - Use
stream.getStats
to 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): void
Create 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