There are lot of video api platforms out there which provides the most of media server functionalities. Jitsi, Janus, Vonage are some popular examples. The focus of this article is to give a brief idea about vonage api and how the API works. In future articles, the usage and development of a webRTC app using Vonage apis will be discussed.

What is Vonage API

“The Vonage Video API platform makes it easy to embed real-time, high-quality interactive video, messaging, screen-sharing, and more into web and mobile apps. The platform includes client libraries for web, iOS, Android, Windows, and Linux, as well as server-side SDKs and a REST API. Vonage Video API uses WebRTC for audio-video communications.”

Higher level architecture

In a particular application, the most higher level components are the client component and the server component. The client component can be a web app that runs on abrowser or a mobile app. For the development of client component the vonage video client-side libraries are be used. The server component which runs on a server uses the vonage video api server SDKs. These SDKs support multiple languages such as Node, PHP, Java, Net, python and Ruby.

The desired functionality from the client component can be listed as bellow,

1. Use the Vonage client-side libraries to connect with server and OpenTok Cloud.

2. Communicate with server component to get a session ID and a token. These details are then used to establish the connection between client application and the OpenTok Cloud.

3. Connects to a OpenTok cloud session

4. Publish and subscribe to the audio video streams.

5. Handle and Listen session events

Similarly, there are some core functionalities that is carried out by a typical server-side component.

1. Use the Server Sdk provided byVonage.

2. Create a session in OpenTok Cloud and retrive the tokens and the session Id

3. sends the sessionId and the token to the client-component.

OpenTok Cloud and sessions

In a typical Vongae Video application the session is a kind of room created at OpenTok cloud. Here is the place where the clients can get together and share their streams between one and another. A typical session as an id, which is then shared between clients. This parameter helps to identify which session that they should connect with.  The server side component is responsible for creating sessions if does not exists, and generate unique authentication tokens. The generated token is then used by client component to establish the connection between OpenTok cloud. Since the clients can identify the sessions there are connected with, they can simply use Vonage APIs to subscribe and publish the video and audio streams.

It is very easy to debug a app which uses the vonage Vedio API. The tool Inspector which is provided by the Vonage shows a complete log in sessions, users, events, errors, and more. This is very useful in development and as well as to understand what is happening under the hood.

Lets try to understand graphically the step flow in a particular Application