Subscribe: Management & Events

This guide covers managing Subscriber behavior and reacting to runtime events, for both Web (JavaScript) and React Native.

Managing streams (React Native)

Detecting when a stream's video dimensions change

A stream's video dimensions can change if a stream published from a mobile device resizes (for example, due to device orientation changes) or if a screen-sharing source window is resized. When a stream's video dimensions change, the Session object dispatches a event, with set to .

Setting the preferred frame rate and resolution

When subscribing to a stream that uses the scalable video feature, you can set to to automatically manage Subscriber video resolution and optimize CPU/network usage. For advanced control, set the preferred frame rate and resolution for the subscribed stream:

  • — Valid values are 30, 15, 7, and 1. Leave undefined to use the highest available frame rate.
  • — Valid values are , , and . Leave undefined to use the highest available resolution.

Detecting when streams leave a session

When a remote stream leaves a session, the component dispatches a event:

The event includes details such as , , , , , and .

Custom rendering of subscribers

By default, renders child views for subscriber videos. You can also provide a render function to fully control rendering using :

Setting stream properties

Set global properties for all subscribers via the prop on , or set per‑stream properties via the prop.