Suggestions

close search

Add Messaging, Voice, and Authentication to your apps with Vonage Communications APIs

Visit the Vonage API Developer Portal
Developer Documentation moved on August 7, 2026. Future updates are available only at → https://developer.vonage.com/en/opentok/overview

Single Peer Connection

Unlock leaner, faster, and more scalable video sessions by funneling all subscriber streams through a single WebRTC peer connection.

As your sessions grow, so does the number of WebRTC peer connections each client has to maintain (one for every subscribed stream). Each connection carries its own ICE negotiation, DTLS handshake, and congestion-control state. That overhead can add up fast, especially on mobile devices.

Single Peer Connection (SPC) reduces the connection setup overhead. When enabled, all subscriber streams for a client are multiplexed over one shared peer connection to the Vonage Video Media Router, regardless of how many different publishers are in the session. The result is a lighter network footprint using fewer ports, smarter bandwidth management, and better scalability across all devices.

The Single Peer Connection feature is only available in routed sessions (sessions that use the Vonage Video Media Router). In sessions using adaptive media routing, SPC does not apply while media flows peer-to-peer between two participants, but it does apply once the session switches to using the Media Router. See The Vonage Video Media Router and media modes.

Benefits

Enabling Single Peer Connection is one of the highest-impact optimizations you can make for multi-party video. Here is what you get:

Use cases

Applications benefit from Single Peer Connection whenever the number of subscribed streams starts to climb. Here are the scenarios where it makes the biggest difference:

Requirements and limitations

Enabling Single Peer Connection

To enable Single Peer Connection, configure it in the client SDK when creating or initializing the session. For a quick overview of SPC in the context of session creation, see the Single Peer Connection section of the Creating a Session guide. The following sections show how to enable it in each supported SDK.

Web SDK

Set the singlePeerConnection property to true in the options object you pass to OT.initSession():

var session = OT.initSession(apiKey, sessionId, {
  singlePeerConnection: true
});

Android SDK

Use the Session.Builder.setSinglePeerConnection() method:

Session session = new Session.Builder(context, apiKey, sessionId)
    .setSinglePeerConnection(true)
    .build();

iOS SDK

Set the singlePeerConnection property on OTSessionSettings:

OTSessionSettings *settings = [[OTSessionSettings alloc] init];
settings.singlePeerConnection = YES;

OTSession *session = [[OTSession alloc] initWithApiKey:apiKey
                                             sessionId:sessionId
                                              delegate:self
                                              settings:settings];

Windows SDK

Set the SinglePeerConnection property on the Session.Builder class:

var session = new Session.Builder(Context.Instance, apiKey, sessionId)
{
    SinglePeerConnection = true
}.Build();

macOS SDK

Use the otc_session_settings_set_single_peer_connection() function:

otc_session_settings *settings = otc_session_settings_new();
otc_session_settings_set_single_peer_connection(settings, OTC_TRUE);

otc_session *session = otc_session_new_with_settings(apiKey, sessionId, &callbacks, settings);

Linux SDK

Use the otc_session_settings_set_single_peer_connection() function:

otc_session_settings *settings = otc_session_settings_new();
otc_session_settings_set_single_peer_connection(settings, OTC_TRUE);

otc_session *session = otc_session_new_with_settings(apiKey, sessionId, &callbacks, settings);

React Native SDK

Set the enableSinglePeerConnection property to true in the options prop of the OTSession component:

<OTSession
  apiKey={apiKey}
  sessionId={sessionId}
  token={token}
  options={{ enableSinglePeerConnection: true }}
/>

Interaction with other features

Scalable video

Single Peer Connection works alongside scalable video. When both features are enabled, the Media Router still delivers multi-quality layers to each subscriber through the shared peer connection. Each subscriber can receive a different resolution and frame rate layer as network conditions change, exactly as it would with separate peer connections.

Audio fallback

Audio fallback continues to operate normally with SPC enabled. If a subscriber's network degrades, the Media Router can still drop the video component and deliver audio only for the affected stream, independent of the other streams carried on the same peer connection.

Client observability and sender-side statistics

When SPC is enabled, the sender-side statistics bandwidth estimation is shared across all subscribers in the single peer connection. The maximum bitrate represents the highest bitrate the peer connection can estimate, while the current bitrate reflects each audio-video bundle's bitrate. When assessing available bandwidth, calculate the total bandwidth estimation by summing the individual bundle estimations.

For more information, see the client observability guide.

End-to-end encryption

End-to-end encryption is compatible with Single Peer Connection. Media streams are encrypted individually before being multiplexed over the shared peer connection.

Best practices

Further reading