Probe SDK
Background
Zoom Probe SDK is a tool that you can use to check if audio and video hardware, network, and Zoom infrastructure offers the best experience for your users. This readme will quickly get you started. For full documentation on usage, see the developer documentation. For details about all of the SDK methods, see the SDK reference.
Install
Install the Probe SDK into your project.
$ npm install @zoom/probesdk --save
Import components
Import the Prober
class from Probe SDK. For example, in your index.js
file.
import { Prober } from "@zoom/probesdk";
const prober = new Prober();
Invoke the Prober()
constructor directly to create an instance of it. Next, you can access any capability of the prober. See the examples below, and the developer documentation for details.
Request media devices and permission
Invoke requestMediaDevicePermission()
to retrieve media device permissions.
import { Prober } from "@zoom/probesdk";
const prober = new Prober();
function getMediaPermission() {
prober.requestMediaDevicePermission({ audio: true, video: true }).then(
(result) => {
console.log(stream=${result.stream?.id}, error:${result.error?.message}`);
}
);
}
Invoke releaseMediaStream(stream)
to release the MediaStream
instance returned by calling requestMediaDevicePermission()
. Note that ProbeSDK is not responsible for setting the stream
to null, the caller should maintain its lifecycle. If stream
is not used anymore, it's a good practice to explicitly set it null
to make it recycled by GC.
function getMediaPermission() {
prober.requestMediaDevicePermission({ audio: true, video: true }).then(
(result) => {
console.log(`stream=${result.stream?.id}, error:${result.error?.message}`);
let succeed = prober.releaseMediaStream(result.stream);
console.log(succeed);
result.stream = null;
}
);
}
Invoke requestMediaDevices()
to retrieve media devices.
import { Prober } from "@zoom/probesdk";
const prober = new Prober();
function getMediaDevices() {
prober.requestMediaDevices().then((result) => {
console.log(`error:${result.error}, devices=${result.devices}`);
});
}
Diagnose audio and video
Invoke diagnoseAudio
to check whether the audio devices work.
import { Prober } from "@zoom/probesdk";
const prober = new Prober();
function startToDiagnoseAudio() {
const audioInputConstraint = {
audio: { deviceId: "default" },
video: false,
};
const audioOutputConstraint = {
audio: { deviceId: "xxxxxxxxxxxxxxxx" },
video: false,
};
const duration = 5000;
const diagnoseResult = prober.diagnoseAudio(
audioInputConstraint,
audioOutputConstraint,
duration
);
console.log(diagnoseResult);
}
Invoke diagnoseVideo
to check whether or not the video devices work.
import { Prober } from "@zoom/probesdk";
const prober = new Prober();
let videoDiagnosticResult;
function startToDiagnoseVideo(canvas) {
const constraint = {
video: {
deviceId: "default",
},
};
const options = {
rendererType: 2,
target: canvas,
};
prober.diagnoseVideo(constraint, options).then((result) => {
console.log(result);
videoDiagnosticResult = result;
});
}
Call stopToDiagnoseVideo(stream)
to stop diagnosing video. The parameter stream
saved in the result of calling diagnoseVideo
is optional. Note that: If you don't pass this parameter when you call this function, it simply stops the preview part of the video diagnostic, and you need to call releaseMediaStream(stream)
at the right time to close the video stream.
import { Prober } from "@zoom/probesdk";
const prober = new Prober();
let videoDiagnosticResult;
function stopToDiagnoseVideo() {
let result = prober.stopToDiagnoseVideo(videoDiagnosticResult.stream);
videoDiagnosticResult.stream = null;
console.log(`stopToDiagnoseVideo() result: ${result}`);
}
prober.releaseMediaStream(videoDiagnosticResult.stream);
Start a comprehensive diagnostic test
Perform a network diagnostic to return a network diagnostic report that also includes basic information and supported features.
import { Prober } from "@zoom/probesdk";
const prober = new Prober();
function startToDiagnose() {
const jsUrl = "";
const wasmUrl = "";
const config = {
probeDuration: 120 * 1000,
connectTimeout: 120 * 1000,
domain: '[a Zoom or custom domain]',
};
prober
.startToDiagnose(jsUrl, wasmUrl, config, (stats) => {
console.log(stats);
})
.then((report) => {
console.log(report.networkDiagnosticResult);
console.log(report.basicInfoEntries);
console.log(report.featureEntries);
});
}
When the diagnostic program is finished, we suggest that it is a good idea to call the cleanup()
function to clean up some of the resources created in ProbeSDK (e.g., some memory resources, closing the network connection used for diagnostics, etc.). For example, it is a good time to call it when the user closes the diagnostics page or jumps to another page.
prober.cleanup();
Generate a report of supported features
This Reporter
provides detection services to report if video conferencing features are supported on the target device.
const reporter = new Reporter();
function showBasicInfo() {
reporter.reportBasicInfo(navigator).then((info) => {
console.log(JSON.stringify(info));
});
}
function showSupportedFeatures() {
reporter.reportFeatures().then((features) => {
console.log(JSON.stringify(features));
});
}
Changelog
For the changelog, see Probe SDK - web.
Support
For any issues regarding our SDK, reach out to Developer Support.
License
Use of this SDK is subject to our License and Terms of Use;
Open Source Software Source Code
Some licenses for OSS contained in our products give you the right to access the source code under said license. You may obtain a copy of source code for the relevant OSS via the following link: https://zoom.us/opensource/source. Please obtain independent legal advice or counsel to determine your responsibility to make source code available under any specific OSS project.
Appendix: Platform/Browser Compatibility
API |
---|
Desktop | Mobile |
---|
Windows | MacOS | Linux | ChromeOS | Android | iOS |
---|
Chrome | Firefox | Edge | Opera | Chrome | Firefox | Edge | Opera | Safari | Chrome | Firefox | Chrome | Chrome | Firefox | Edge | Chrome | Safari | Firefox |
---|
requestMediaDevicePermission | Y(125 64-bit) | Y(125.0.1 64-bit) | Y(124 64-bit) | Y(110 64-bit) | Y(125 64-bit) | Y(126.0.1 64-bit) | Y(125 64-bit) | Y(110 64-bit) | Y(17.5) | Y(113 64-bit) | Y(114.0 64-bit) | Y(124 64-bit) | Y(125 64-bit) | Y(125 64-bit)Y | Y(125 64-bit) | Y(125) | Y(17.5) | Y(126.2) |
---|
releaseMediaStream | Y(125 64-bit) | Y(125.0.1 64-bit) | Y(124 64-bit) | Y(110 64-bit) | Y(125 64-bit) | Y(126.0.1 64-bit) | Y(125 64-bit) | Y(110 64-bit) | Y(17.5) | Y(113 64-bit) | Y(114.0 64-bit) | Y(124 64-bit) | Y(125 64-bit) | Y(125 64-bit)Y | Y(125 64-bit) | Y(125) | Y(17.5) | Y(126.2) |
---|
requestMediaDevices | Y(125 64-bit) | Y(125.0.1 64-bit) | Y(124 64-bit) | Y(110 64-bit) | Y(125 64-bit) | Y(126.0.1 64-bit) | Y(125 64-bit) | Y(110 64-bit) | Y(17.5) | Y(113 64-bit) | Y(114.0 64-bit) | Y(124 64-bit) | Y(125 64-bit) | Y(125 64-bit) | Y(125 64-bit) | Y(125) | Y(17.5) | Y(126.2) |
---|
diagnoseAudio | Y(125 64-bit) | Y(125.0.1 64-bit) | Y(124 64-bit) | Y(110 64-bit) | Y(125 64-bit) | Y(126.0.1 64-bit) | Y(125 64-bit) | Y(110 64-bit) | Y(17.5) | Y(113 64-bit) | Y(114.0 64-bit) | Y(124 64-bit) | Y(125 64-bit) | Y(125 64-bit) | Y(125 64-bit) | Y(125) | Y(17.5) | Y(126.2) |
---|
diagnoseVideo | Y(125 64-bit) | Y(125.0.1 64-bit)
WebGPU | Y(124 64-bit) | Y(110 64-bit) | Y(125 64-bit) | Y(126.0.1 64-bit) | Y(125 64-bit) | Y(110 64-bit) | Y(17.5)
WebGPU | Y(113 64-bit)
WebGPU | Y(114.0 64-bit)
WebGPU | Y(124 64-bit) | Y(125 64-bit) | Y(125 64-bit)
WebGPU | Y(125 64-bit)
WebGPU | Y(125)
WebGPU | Y(17.5)
WebGPU | Y(126.2)
WebGPU |
---|
stopToDiagnoseVideo | Y(125 64-bit) | Y(125.0.1 64-bit) | Y(124 64-bit) | Y(110 64-bit) | Y(125 64-bit) | Y(126.0.1 64-bit) | Y(125 64-bit) | Y(110 64-bit) | Y(17.5) | Y(113 64-bit) | Y(114.0 64-bit) | Y(124 64-bit) | Y(125 64-bit) | Y(125 64-bit) | Y(125 64-bit) | Y(125) | Y(17.5) | Y(126.2) |
---|
startToDiagnose | Y(125 64-bit) | Y(125.0.1 64-bit) | Y(124 64-bit) | Y(110 64-bit) | Y(125 64-bit) | Y(126.0.1 64-bit) | Y(125 64-bit) | Y(110 64-bit) | Y(17.5) | Y(113 64-bit) | Y(114.0 64-bit) | Y(124 64-bit) | Y(125 64-bit) | Y(125 64-bit) | Y(125 64-bit) | Y(125) | Y(17.5) | Y(126.2) |
---|
Copyright ©2024 Zoom Video Communications, Inc. All rights reserved.