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
- A Relayed session offers the benefit of reduced latency. By having end users directly connect to each other, there are fewer network hops.
- 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, he sends just one stream to the Media Server. The Media Server replicates the streams and sends them out to all subscribers. This way, the publisher's upload bandwidth consumption is reduced.
- 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 main drawback of using a Routed stream is that there might be some latency added versus connecting directly to a peer. In most cases 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.