What are the differences between the types of sessions you can create with the Vonage Video API?
- Vonage Video API
- Relayed Sessions
- Routed Sessions
- Media Streams
You can create two types of Vonage Video API sessions: Relayed, which are peer-to-peer, and Routed, which go through Vonage's media server.
Though there are only two types of sessions, there are three different ways that media streams can be sent:
- Relayed (Peer-to-Peer) sessions in which the audio and video streams are sent between the users directly.
- Relayed (Peer-to-Peer) sessions in which the audio and video streams are sent through Vonage's Relay Servers due to an inability to connect directly to their peer. This happens because one or both the users are located behind a firewall.
- Routed sessions are explicitly routed through Vonage's Media Servers. This provides a number of features such as archiving, reduced upload bandwidth in group calls, and Audio-Only Fallback.
Advantages and Limitations of Each Media Stream
- Relayed sessions are ideal for 1:1 calls and provide the best performance in these cases.
- A Relayed session offers the benefit of reduced latency. By having end users directly connect to each other, there are fewer network hops.
- Relayed sessions are not recommended for multi-party calls due to increased network usage in these scenarios.
- The downside of using a Relayed stream is that you will not be able to take advantage of various rich features that Vonage's Media Servers provide such as archiving, Audio-Only Fallback, as well as reducing upload bandwidth for group calls.
- Reduced upload bandwidth - If a publisher is streaming to multiple subscribers (multi-party), they send just one stream to the Media Server. The Media Server replicates the stream and sends it to all subscribers. This reduces publisher upload bandwidth usage.
- Archiving - Archiving is possible only if a session is routed because it is the Media Server that records the stream. Relayed (peer-to-peer) sessions cannot be archived.
- Audio-Only Fallback - If the Media Server detects that there are bandwidth limitations on a Subscriber's network, then it automatically switches the subscriber to an Audio-Only mode.
- The only small drawback of using a Routed stream is that there might be some limted latency added versus connecting directly to a peer. In most cases, however, the latency difference will be negligible and it shouldn't be noticeable for video chat scenarios. In certain low-bandwidth situations it can be a factor but this is offset by additional features such as Audio-Only Fallback (described above) that actually help keep users connected and streaming in low bandwidth scenarios.