OpenTok Pre-Call test, Network test, and getStats() API OpenTok Pre-Call test, Network test, and getStats() API

OpenTok Pre-Call test, Network test, and getStats() API

Puspendra Yadav

What is the getStats API?

getStats is defined in the WebRTC standard. It provides a guideline on how browsers can communicate raw quantitative data to applications. Our APIs make this data available using the getStats() method in our JavaScript SDK. These are available for both the publisher and subscriber.

This is useful for developers who are very comfortable with OpenTok core concepts/session architecture and have familiarity with online audio/video metrics.

What is the OpenTok Network Test?

The Network Test is a Node module that enables an additional set of APIs. These are built on top of and using the getStats API. They take the raw data from getStats() and present it in a way that is easier to understand and use.

The Network Test provides information that can be useful for diagnosing session health (bitrate, packet loss, latency, and MOS quality score). It can be used to build a solution similar to the Pre-call test, diagnose potential issues programmatically, or simply to determine expected call quality.

What is the OpenTok Pre-call test?

The Pre-call test for Vonage Video API Opentok environment or Vonage Video API Unified environment is an application that uses Network test APIs to check a client's capabilities, including:

  1. browser compatibility
  2. acquiring camera and microphone
  3. reaching Vonage Video API servers
  4. connecting to Vonage Video API signaling server
  5. connecting to Vonage Video API media server
  6. connecting to Vonage Video API signaling server

It also provides a summary of expected call quality at the time. This tool is intended to help diagnose potentially problematic clients and provide a way to determine why they are running into issues.

Customers who integrate Pre-call in their application, with OpenTok.js 2.24.7 and above are recommended to explicitly disable the ‘scalableVideo’, in order to avoid pessimistic network assessment. OpenTok Network Test library v2.5.0 onwards initializes the publisher with scalableVideo as false by default.