OptionalaudioConfig?: {OptionalencoderConfig?: | Encoder Config | Bitrate | Auto Gain | Echo Cancellation | Noise Suppression |
|---|---|---|---|---|
| speech_low_quality | 16 kbps | TRUE | TRUE | TRUE |
| speech_standard | 24 kbps | TRUE | TRUE | TRUE |
| music_standard | 32 kbps | FALSE | FALSE | FALSE |
| standard_stereo | 64 kbps | FALSE | FALSE | FALSE |
| high_quality | 128 kbps | FALSE | FALSE | FALSE |
| high_quality_stereo | 192 kbps | FALSE | FALSE | FALSE |
OptionalmicrophoneId?: stringIt will be the id of the mic from which the audio should be captured.
OptionalnoiseConfig?: {Configuration for audio noise processing.
If true auto gain will turned on else it would be turned off.
If true echo cancellation will turned on else it would be turned off.
If true noise suppression will turned on else it would be turned off.
OptionalaudioOnly?: booleanSkips the camera test and runs the pre-call test using audio only.
OptionalaudioTrack?: MediaStreamYour own microphone track that is created by createMicrophoneAudioTrack.
OptionalonStatsChange?: (stats: object) => voidReceives the latest network stats while the test is running.
OptionalsamplingDuration?: numberDuration for sampling stats during the test, in milliseconds.
Minimum: 10000, Maximum: 120000.
Authentication token used to authorize SDK operations. You can generate a token in the following ways:
OptionalvideoConfig?: {OptionalbitrateMode?: "high_quality" | "balanced" | "bandwidth_optimized"Controls the video quality and bandwidth consumption. You can choose between high_quality for the best picture, bandwidth_optimized to save data, or balanced for a mix of both. Defaults to balanced.
Allowed Value: BitrateMode
OptionalcameraId?: stringIt will be the id of the camera from which the video should be captured.
OptionalencoderConfig?: You can choose from the below mentioned list of values for the encoder config.
Supported values include:
| Encoder Config | Resolution | Frame Rate | Optimized (kbps) | Balanced (kbps) | High Quality (kbps) |
|---|---|---|---|---|---|
| h90p_w160p | 160x90 | 15 fps | 60 | 100 | 150 |
| h180p_w320p | 320x180 | 15 fps | 100 | 150 | 250 |
| h216p_w384p | 384x216 | 15 fps | 120 | 200 | 350 |
| h360p_w640p | 640x360 | 20 fps | 200 | 400 | 600 |
| h540p_w960p | 960x540 | 25 fps | 350 | 550 | 800 |
| h720p_w1280p | 1280x720 | 30 fps | 1000 | 1500 | 2000 |
| h1080p_w1920p | 1920x1080 | 30 fps | 1600 | 2200 | 2700 |
| h1440p_w2560p | 2560x1440 | 30 fps | 5000 | 5500 | 6000 |
| h2160p_w3840p | 3840x2160 | 30 fps | 8000 | 8500 | 9000 |
| h120p_w160p | 160x120 | 15 fps | 60 | 100 | 150 |
| h180p_w240p | 240x180 | 15 fps | 100 | 150 | 250 |
| h240p_w320p | 320x240 | 15 fps | 120 | 200 | 350 |
| h360p_w480p | 480x360 | 20 fps | 200 | 400 | 600 |
| h480p_w640p | 640×480 | 25 fps | 300 | 500 | 700 |
| h540p_w720p | 720×540 | 30 fps | 350 | 550 | 800 |
| h720p_w960p | 960×720 | 30 fps | 900 | 1300 | 1600 |
| h1080p_w1440p | 1440×1080 | 30 fps | 1600 | 2200 | 2700 |
| h1440p_w1920p | 1920×1440 | 30 fps | 3500 | 4000 | 4500 |
Note
Above mentioned encoder configurations are valid for both, landscape as well as portrait mode.
OptionalfacingMode?: "user" | "environment"Specifies whether to use the front or back camera for the video track.
OptionalmaxLayer?: 2 | 3Specifies the maximum number of simulcast layers to publish. Only effective when multiStream is true.
OptionalmultiStream?: booleanIt will specify if the stream should send multiple resolution layers or single resolution layer.
Info
For meetings with fewer than or equal to four participants, setting
multiStream:falseis regarded as best practice.
OptionaloptimizationMode?: "text" | "motion" | "detail"It will specify the optimization mode for the video track being generated.
OptionalvideoTrack?: MediaStreamYour own camera track that is created by createCameraVideoTrack.
Idempotent method to stop the ongoing pre-call test. Cleans up all allocated resources and resolves once teardown is complete.
import { runPreCallTest } from "@videosdk.live/react-sdk";
runPreCallTest({
token: TOKEN,
samplingDuration: 120000,
audioOnly: true,
videoTrack: customVideoTrack,
audioTrack: customAudioTrack,
onStatsChange: (stats) => {
console.log("stats", stats);
},
})
.then((result) => {
console.log("Pre-call test result:", result);
})
.catch((err) => {
console.log("code : " + err.code);
console.log("message : " + err.message);
});
Promisethat resolves with the test results or rejects with a PreCallTestError if the test fails.optionsparameter can be used to configure the test duration, provide custom media tracks, and receive live stats updates via theonStatsChangecallback.Promisealso includes a.stop()method, which allows the test to be cancelled before completion.