@zoom/probesdk

1.0.0 • Public • Published

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.

// index.js
import { Prober } from "@zoom/probesdk";

// create a new instance of Prober
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.

// index.js
import { Prober } from "@zoom/probesdk";

// create a new instance of Prober
const prober = new Prober();

// request media permission
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.

// request media permission
function getMediaPermission() {
    prober.requestMediaDevicePermission({ audio: true, video: true }).then(
      (result) => {
        console.log(`stream=${result.stream?.id}, error:${result.error?.message}`);
        
        // if the stream is not used anymore, it's good practice to release it.
        let succeed = prober.releaseMediaStream(result.stream);
        console.log(succeed);
        
        // ProbeSDK is not responsible for setting it null, the caller should maintain its lifecycle
        result.stream = null;
      }
    );
}

Invoke requestMediaDevices() to retrieve media devices.

// index.js
import { Prober } from "@zoom/probesdk";

// create a new instance of Prober
const prober = new Prober();

// request media devices
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.

// index.js
import { Prober } from "@zoom/probesdk";

// create a new instance of Prober
const prober = new Prober();

// start an audio diagnostic
function startToDiagnoseAudio() {
  const audioInputConstraint = {
    audio: { deviceId: "default" },
    video: false,
  };
  const audioOutputConstraint = {
    audio: { deviceId: "xxxxxxxxxxxxxxxx" },
    video: false,
  };

  const duration = 5000; // how long you want to record the sound, milliseconds
  const diagnoseResult = prober.diagnoseAudio(
    audioInputConstraint,
    audioOutputConstraint,
    duration
  );
  console.log(diagnoseResult);
}

Invoke diagnoseVideo to check whether or not the video devices work.

// index.js
import { Prober } from "@zoom/probesdk";

// create a new instance of Prober
const prober = new Prober();

// start a video diagnostic
function startToDiagnoseVideo(canvas) {
  const constraint = {
    video: {
      deviceId: "default",
    },
  };
  const options = {
    type: 2, // WebGL
    target: canvas,
  };
  prober.diagnoseVideo(constraint, options).then((diagnosticResult) => {
    console.log(diagnosticResult);
  });
}

Start a comprehensive diagnostic test

Perform a network diagnostic to return a network diagnostic report that also includes basic information and supported features.

// index.js
import { Prober } from "@zoom/probesdk";

// create a new instance of Prober
const prober = new Prober();

function startToDiagnose() {
  // 1. you can ignore the URLs, so the default URLs that deployed in the ProbeSDK will be used
  const jsUrl = "";
  const wasmUrl = "";
  const config = { probeDuration: 120 * 1000, connectTimeout: 120 * 1000 };
  prober
    .startToDiagnose(jsUrl, wasmUrl, config, (stats) => {
      console.log(stats);
    })
    .then((report) => {
      // a DiagnosticReport has main 3 structures we need to handle
      console.log(report.networkDiagnosticResult);
      console.log(report.basicInfoEntries);
      console.log(report.featureEntries);
    });
}

Generate a report of supported features

This Reporter provides detection services to report if videoconferencing 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.

Dependents (0)

Package Sidebar

Install

npm i @zoom/probesdk

Weekly Downloads

7

Version

1.0.0

License

SEE LICENSE IN LICENSE.md

Unpacked Size

2.37 MB

Total Files

40

Last publish

Collaborators

  • tommygaessler
  • zoomwebteam
  • clever.su
  • endazoom