UNPKG

@zoom/probesdk

Version:

Zoom ProbeSDK tests the end user device and network capabilities, and the Zoom server connection.

3,760 lines (1,067 loc) 110 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Global</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Global</h1> <section> <header> <h2></h2> </header> <article> <div class="container-overview"> <dl class="details"> </dl> </div> <h3 class="subsection-title">Members</h3> <h4 class="name" id="BANDWIDTH_QUALITY_LEVEL"><span class="type-signature">(constant) </span>BANDWIDTH_QUALITY_LEVEL<span class="type-signature"> :number</span></h4> <div class="description"> <p>Enumeration of the bandwidth quality level.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>VERY_LOW</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>bandwidth quality is very low. Default value is 0.</p></td> </tr> <tr> <td class="name"><code>LOW</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>bandwidth quality is low. Default value is 1.</p></td> </tr> <tr> <td class="name"><code>NORMAL</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>bandwidth quality is normal. Default value is 2.</p></td> </tr> <tr> <td class="name"><code>UNDEFINED</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>bandwidth quality is unknown. If get this value, means the network diagnostic is not started yet or gets some exceptions. Default value is 255.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h4 class="name" id="BASIC_INFO_ATTR_INDEX"><span class="type-signature">(constant) </span>BASIC_INFO_ATTR_INDEX<span class="type-signature"> :number</span></h4> <div class="description"> <p>Enumeration of attribute index of the basic information.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>BROWSER_NAME</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the name of the browser. Default value is 0.</p></td> </tr> <tr> <td class="name"><code>BROWSER_VERSION</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the version of the browser. Default value is 1.</p></td> </tr> <tr> <td class="name"><code>OS_NAME</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the name of the OS. Default value is 2.</p></td> </tr> <tr> <td class="name"><code>USER_AGENT</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the user agent. Default value is 3.</p></td> </tr> <tr> <td class="name"><code>HW_CONCURRENCY</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the hardware concurrency. Default value is 4.</p></td> </tr> <tr> <td class="name"><code>GPU_VENDOR</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the GPU vendor. Default value is 5.</p></td> </tr> <tr> <td class="name"><code>GPU_RENDERER</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the GPU renderer information. Default value is 6.</p></td> </tr> <tr> <td class="name"><code>VIDEOFRAME</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the VideoFrame API. Default value is 7.</p></td> </tr> <tr> <td class="name"><code>OFFSCREENCANVAS</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the OffscreenCanvas API. Default value is 8.</p></td> </tr> <tr> <td class="name"><code>SIMD</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the SIMD feature. Default value is 9.</p></td> </tr> <tr> <td class="name"><code>WEB_CODEC</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the web codec feature. Default value is 10.</p></td> </tr> <tr> <td class="name"><code>HW_ACC</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the hardware acceleration. Default value is 11.</p></td> </tr> <tr> <td class="name"><code>GRAPHICS_ACC</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the graphics acceleration in chromium system settings. Default value is 12.</p></td> </tr> <tr> <td class="name"><code>MIN_BROWSER_VERSION</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the minimum browser version. Default value is 13.</p></td> </tr> <tr> <td class="name"><code>SHARED_ARRAY_BUFFER</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the SharedArrayBuffer. Default value is 14.</p></td> </tr> <tr> <td class="name"><code>BUILD_BITNESS</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>represents the build bitness(32bit or 64bit). Default value is 15.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h4 class="name" id="DEF_CONNECT_TIMEOUT"><span class="type-signature">(constant) </span>DEF_CONNECT_TIMEOUT<span class="type-signature"></span></h4> <div class="description"> <p>The default connection timeout, 20 seconds.</p> </div> <dl class="details"> </dl> <h4 class="name" id="DEF_PROBE_DURATION"><span class="type-signature">(constant) </span>DEF_PROBE_DURATION<span class="type-signature"></span></h4> <div class="description"> <p>The default probing duration, 120 seconds.</p> </div> <dl class="details"> </dl> <h4 class="name" id="ERR_CODE"><span class="type-signature">(constant) </span>ERR_CODE<span class="type-signature"> :number</span></h4> <div class="description"> <p>Enumeration of a collection of customized error codes defined and used by ProberSDK.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>OK</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>Indicates a successful operation. Default value is 0.</p></td> </tr> <tr> <td class="name"><code>INVALID_ARGS</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>Indicates invalid arguments passed to a function. Default value is -1.</p></td> </tr> <tr> <td class="name"><code>API_NOT_SUPPORTED</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>Indicates that a specific API is not supported. Default value is -2.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h4 class="name" id="NETWORK_QUALITY_LEVEL"><span class="type-signature">(constant) </span>NETWORK_QUALITY_LEVEL<span class="type-signature"> :number</span></h4> <div class="description"> <p>Enumeration of the network quality level.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>VERY_BAD</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>network quality is very bad. Default value is 0.</p></td> </tr> <tr> <td class="name"><code>BAD</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>network quality is bad. Default value is 1.</p></td> </tr> <tr> <td class="name"><code>NOT_GOOD</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>network quality is not good enough. Default value is 2.</p></td> </tr> <tr> <td class="name"><code>FAIR</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>network quality is fine. Default value is 3.</p></td> </tr> <tr> <td class="name"><code>GOOD</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>network quality is good. Default value is 4.</p></td> </tr> <tr> <td class="name"><code>EXCELLENT</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>network quality is excellent. Default value is 5.</p></td> </tr> <tr> <td class="name"><code>UNDEFINED</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>network quality is unknown. If get this value, means the network diagnostic is not started yet or gets some exceptions. Default value is 255.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h4 class="name" id="NET_PROBING_DATA_TYPE"><span class="type-signature">(constant) </span>NET_PROBING_DATA_TYPE<span class="type-signature"> :number</span></h4> <div class="description"> <p>Enumeration of the data type of the network diagnostic. It will be used to determine the type of data you received and how to handle them.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>STATS</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>indicates the realtime statistics of the network diagnostic. Default value is 1.</p></td> </tr> <tr> <td class="name"><code>REPORT</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>indicates the final report of diagnostic, basic information and supported features. Default value is 2.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h4 class="name" id="PROTOCOL_TYPE"><span class="type-signature">(constant) </span>PROTOCOL_TYPE<span class="type-signature"> :number</span></h4> <div class="description"> <p>Enumeration of the protocol type that ProbeSDK checks in a network diagnostic.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>HTTPS</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>https(https://) protocol. Default value is 1.</p></td> </tr> <tr> <td class="name"><code>WEB_SOCKET</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>WebSocket(wss:// ws://) protocol. Default value is 2.</p></td> </tr> <tr> <td class="name"><code>DATA_CHANNEL</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>the data channel which is used for media communication. Default value is 3.</p></td> </tr> <tr> <td class="name"><code>WEB_TRANSPORT</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>WebTransport protocol(not supported now). Default value is 4.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h4 class="name" id="RENDERER_TYPE"><span class="type-signature">(constant) </span>RENDERER_TYPE<span class="type-signature"> :number</span></h4> <div class="description"> <p>Enumeration of the rendering types supported by ProbeSDK.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>VIDEO_TAG</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>a video stream will be rendered on the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video">video</a> tag. Default value is 1.</p></td> </tr> <tr> <td class="name"><code>WEBGL</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>a video stream will be rendered on a canvas with a <a href="https://developer.mozilla.org/en-US/docs/Glossary/WebGL">WebGL</a> renderer. Default value is 2.</p></td> </tr> <tr> <td class="name"><code>WEBGL_2</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>a video stream will be rendered on a canvas with a <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API#webgl_2">WebGL2</a> renderer. Default value is 3.</p></td> </tr> <tr> <td class="name"><code>WEBGPU</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>a video stream will be rendered on a canvas with a <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API">WebGPU</a> renderer. Default value is 4.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h4 class="name" id="SUPPORTED_FEATURE_INDEX"><span class="type-signature">(constant) </span>SUPPORTED_FEATURE_INDEX<span class="type-signature"> :number</span></h4> <div class="description"> <p>Enumeration of index of the supported features.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">number</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>AUDIO_DENOISE</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>feature index of audio denoise. Default value is 0.</p></td> </tr> <tr> <td class="name"><code>AEC</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>feature index of audio echo cancellation. Default value is 1.</p></td> </tr> <tr> <td class="name"><code>AUDIO_STEREO</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>feature index of audio stereo. Default value is 2.</p></td> </tr> <tr> <td class="name"><code>VIRTUAL_BACKGROUND</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>feature index of video virtual background. Default value is 3.</p></td> </tr> <tr> <td class="name"><code>VIDEO_MASK</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>feature index of video mask. Default value is 4.</p></td> </tr> <tr> <td class="name"><code>WEBGPU</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>feature index of video WebGPU rendering. Default value is 5.</p></td> </tr> <tr> <td class="name"><code>VIDEO_SEND_HD</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>feature index of video sending HD. Default value is 6.</p></td> </tr> <tr> <td class="name"><code>VIDEO_SEND_FULL_HD</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>feature index of video sending full HD. Default value is 7.</p></td> </tr> <tr> <td class="name"><code>DT_GALLERY_VIEW_3x3</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>feature index of desktop supporting 3x3 gallery view. Default value is 8.</p></td> </tr> <tr> <td class="name"><code>DT_GALLERY_VIEW_5x5</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>feature index of desktop supporting 5x5 gallery view. Default value is 9.</p></td> </tr> <tr> <td class="name"><code>SCREEN_SHARING</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last"><p>feature index of screen sharing. Default value is 10.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="canSupportStringLength"><span class="type-signature"></span>canSupportStringLength<span class="signature">(len)</span><span class="type-signature"> &rarr; {boolean}</span></h4> <div class="description"> <p>Test whether can allocate a string of a given length.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>len</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>a length of string to be allocated.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>true if the string can be allocated, false otherwise.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> <h4 class="name" id="cleanup"><span class="type-signature"></span>cleanup<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> <p>Cleanup the resources created in ProbeSDK, like network connections, rendering resources, etc.</p> </div> <dl class="details"> </dl> <h5>Example</h5> <pre class="prettyprint"><code>prober.cleanup();</code></pre> <h4 class="name" id="diagnoseAudio"><span class="type-signature"></span>diagnoseAudio<span class="signature">(inputConstraints, outputConstraints, duration<span class="signature-attributes">opt</span>, mimeType<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="global.html#DiagnosticResult">DiagnosticResult</a>}</span></h4> <div class="description"> <p>Performs audio diagnostic by recording audio from an input device and playing it through an output device. Diagnose any audio input/output devices by passing the constraints of the selected devices. Adjust how long you record the audio by setting the duration parameter. Specify the mime type of how to record the audio by setting the mimeType parameter.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>inputConstraints</code></td> <td class="type"> <span class="param-type">MediaStreamConstraints</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The constraints for capturing audio from input devices.</p></td> </tr> <tr> <td class="name"><code>outputConstraints</code></td> <td class="type"> <span class="param-type">MediaStreamConstraints</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>The constraints for playing audio through output devices.</p></td> </tr> <tr> <td class="name"><code>duration</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> 0 </td> <td class="description last"><p>The duration of the recording in milliseconds. If 0, 5000 milliseconds is used as default value.</p></td> </tr> <tr> <td class="name"><code>mimeType</code></td> <td class="type"> <span class="param-type">string</span> | <span class="param-type">undefined</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> '' </td> <td class="description last"><p>The MIME type of the recorded audio. Default is an empty string. If pass an empty string or undefined, the mime type 'audio/webm;codecs=opus' will be used as the default value.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Throws:</h5> <dl> <dt> <div class="param-desc"> <p>If any parameters are invalid, a customized Error will be thrown. The standard exceptions, like <a href="https://developer.mozilla.org/en-US/docs/Web/API/DOMException">DOMException</a>, will be thrown if are captured while recording and playing.</p> </div> </dt> <dd></dd> <dt> <dl> <dt> Type </dt> <dd> <span class="param-type">Error</span> </dd> </dl> </dt> <dd></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>An object indicating the result of the audio diagnostic.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="global.html#DiagnosticResult">DiagnosticResult</a></span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>const audioInputConstraint = { audio: { deviceId: 'default' }, video: false, }; const audioOutputConstraint = { audio: { deviceId: 'xxxxxxxxxxxxxxxx' }, video: false, }; try { const diagnoseResult = prober.diagnoseAudio(audioInputConstraint, audioOutputConstraint, 0, ''); console.log(diagnoseResult); } catch (e) { console.error(e); }</code></pre> <h4 class="name" id="diagnoseVideo"><span class="type-signature">(async) </span>diagnoseVideo<span class="signature">(constraints, options)</span><span class="type-signature"> &rarr; {<a href="global.html#DiagnosticResult">DiagnosticResult</a>}</span></h4> <div class="description"> <p>Diagnose video device like camera and show the result on a renderable object. You can select a camera by setting constraints and different renderer type by setting the parameter options. Four renderer types are supported by ProbeSDK. Please refer to the documentation of <a href="global.html#RENDERER_TYPE">RENDERER_TYPE</a>.</p> <p>Once the video diagnostic is launched, a MediaStream object is saved to the field <code>stream</code> of <a href="global.html#DiagnosticResult">DiagnosticResult</a>. It is necessary when you want to stop the video diagnostic, if not stopping it, the camera capturing currently is always working.</p> <p>Different renderer types require different <a href="global.html#RendererOptions">RendererOptions</a>:</p> <ul> <li>VIDEO_TAG requires a video element(HTMLMediaElement)</li> <li>WebGL/WebGL2/WebGPU requires a canvas(HTMLCanvasElement) or an OffscreenCanvas(OffscreenCanvas)</li> </ul> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>constraints</code></td> <td class="type"> <span class="param-type">MediaStreamConstraints</span> </td> <td class="description last"><p>A camera constraints which is diagnosed.</p></td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type"><a href="global.html#RendererOptions">RendererOptions</a></span> </td> <td class="description last"><p>The options of how to render a video stream, includes the a renderer type and a target where to render.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Throws:</h5> <dl> <dt> <div class="param-desc"> <p>If any parameters are invalid, a customized Error will be thrown, or some standard exceptions like DOMException will be thrown during the diagnostic</p> </div> </dt> <dd></dd> <dt> <dl> <dt> Type </dt> <dd> <span class="param-type">Error</span> </dd> </dl> </dt> <dd></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Indicates the result of the video diagnostic.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="global.html#DiagnosticResult">DiagnosticResult</a></span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>// for video tag case, you can: // in your html file, to define a video tag &lt;video id="local_preview_video" width="640" height="480" autoplay hidden>&lt;/video> const preview_video = document.getElementById('local_preview_video'); const constraints = { video: { width: preview_video.width, height: preview_video.height, deviceId: document.getElementById("camera_list").value, // need a deviceId of a camera }, }; const options = { rendererType: 1, // 1 for video_tag target: preview_video, }; const diagnosticResult = await prober.diagnoseVideo(constraints, options); console.log(diagnosticResult); // for WebGL/WebGL2/WebGPU case, you can: // in your html file, to define a canvas &lt;canvas id="local_preview_canvas" width="640" height="480">&lt;/canvas>&lt;/br> const preview_canvas = document.getElementById('local_preview_canvas'); const constraints = { video: { width: preview_canvas.width, height: preview_canvas.height, deviceId: document.getElementById("camera_list").value, // need a deviceId of a camera }, }; const options = { rendererType: 2, // WebGL target: preview_canvas, }; const result = await prober.diagnoseVideo(constraints, options); console.log(result);</code></pre> <h4 class="name" id="queryRid"><span class="type-signature"></span>queryRid<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> <p>Query the trackingId(rid) of last round of probing.</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>rid a string is used to track the last round of network diagnosis. If the result is an empty string or undefined, it means that the last round of network diagnosis fails.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>const rid = prober.queryRid(); console.log(rid);</code></pre> <h4 class="name" id="releaseMediaStream"><span class="type-signature"></span>releaseMediaStream<span class="signature">(stream)</span><span class="type-signature"> &rarr; {boolean}</span></h4> <div class="description"> <p>Releases the resources associated with a given MediaStream.</p> <p>This function stops all tracks in the provided MediaStream to release the hardware resources (e.g., camera, microphone) and removes them from the stream. It ensures that no resources are left in use after the MediaStream is no longer needed.</p> <p>Note that ProbeSDK is not responsible for setting the stream you pass to null. So, the caller should maintain its lifecycle.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>stream</code></td> <td class="type"> <span class="param-type">MediaStream</span> </td> <td class="description last"><p>The MediaStream object to release.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <ul> <li>Returns <code>true</code> if the stream was successfully released, or <code>false</code> if the input was invalid (e.g., null or undefined).</li> </ul> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>const stream = await navigator.mediaDevices.getUserMedia({ video: true }); let result = releaseMediaStream(stream); console.log(result);</code></pre> <h4 class="name" id="reportBasicInfo"><span class="type-signature">(async) </span>reportBasicInfo<span class="signature">(navigator)</span><span class="type-signature"> &rarr; {Promise.&lt;{Array.&lt;<a href="global.html#BasicInfoEntry">BasicInfoEntry</a>>}>}</span></h4> <div class="description"> <p>Report basic information of the target device, like browser information, OS, etc.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>navigator</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"><p>the state and the identity of the user agent.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>A promise that resolves to an array of basic information entries.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;{Array.&lt;<a href="global.html#BasicInfoEntry">BasicInfoEntry</a>>}></span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>const reporter = new Reporter(); reporter.reportBasicInfo(navigator).then((info) => { console.log(JSON.stringify(info)); });</code></pre> <h4 class="name" id="reportFeatures"><span class="type-signature">(async) </span>reportFeatures<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;{Array.&lt;<a href="global.html#FeatureEntry">FeatureEntry</a>>}>}</span></h4> <div class="description"> <p>Report whether the advanced features are supported or not on the target device.</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>A promise that resolves to an array of advanced media features.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;{Array.&lt;<a href="global.html#FeatureEntry">FeatureEntry</a>>}></span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>const reporter = new Reporter(); reporter.reportFeatures().then((features) => { console.log(JSON.stringify(features)); });</code></pre> <h4 class="name" id="requestMediaDevicePermission"><span class="type-signature">(async) </span>requestMediaDevicePermission<span class="signature">(constraints)</span><span class="type-signature"> &rarr; {Promise.&lt;{stream: MediaStream, error: Error}>}</span></h4> <div class="description"> <p>Requests media device permission asynchronously.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>constraints</code></td> <td class="type"> <span class="param-type">MediaStreamConstraints</span> </td> <td class="description last"><p>The constraints for the requested media stream.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Throws:</h5> <dl> <dt> <div class="param-desc"> <p>If the constraint argument is undefined.</p> </div> </dt> <dd></dd> <dt> <dl> <dt> Type </dt> <dd> <span class="param-type">Error</span> </dd> </dl> </dt> <dd></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>A promise that resolves to an object containing either the requested media stream or an error object. The error object may be an instance of <a href="https://developer.mozilla.org/en-US/docs/Web/API/DOMException">DOMException</a> or other standard system exceptions.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;{stream: MediaStream, error: Error}></span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>import { Prober } from "@zoom/probesdk"; const prober = new Prober(); function getMediaDevices() { prober.requestMediaDevices().then((result) => { console.log(`error:${result.error}, devices=${result.devices}`); }); }</code></pre> <h4 class="name" id="requestMediaDevices"><span class="type-signature">(async) </span>requestMediaDevices<span class="signatur