Skip to content

Commit

Permalink
docs: add a note about participant list truncation and livestreaming …
Browse files Browse the repository at this point in the history
…use case (#1559)
  • Loading branch information
myandrienko authored Nov 6, 2024
1 parent 52d7a61 commit 121a736
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ const subscription = call.state.participants$.subscribe((participants) => {
subscription.unsubscribe();
```

In a call with many participants, the value of the `participants$` call state observable is truncated to 250 participants. The participants who are publishing video, audio, or screen sharing have priority over the other participants in the list. This means, for example, that in a livestream with one host and many viewers, the host is guaranteed to be in the list.

## Client state

The client state can be accessed by `client.state`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,12 @@ const hosts = participants.filter((p) => p.roles.includes('host'));

// participants that publish video and audio
const videoParticipants = participants.filter(
(p) => hasVideo(p) && hasAudio(p),
(p) => hasVideo(p) && hasAudio(p)
);
```

In a call with many participants, the list returned by the `useParticipants` call state hook is truncated to 250 participants. The participants who are publishing video, audio, or screen sharing have priority over the other participants in the list. This means, for example, that in a livestream with one host and many viewers, the host is guaranteed to be in the list.

## Client state

To observe client state you need to provide a `StreamVideoClient` instance to the `StreamVideo` context provider.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ const videoParticipants = participants.filter(
);
```

In a call with many participants, the list returned by the `useParticipants` call state hook is truncated to 250 participants. The participants who are publishing video, audio, or screen sharing have priority over the other participants in the list. This means, for example, that in a livestream with one host and many viewers, the host is guaranteed to be in the list.

## Client state

To observe client state you need to provide a `StreamVideoClient` instance to the `StreamVideo` context provider.
Expand Down

0 comments on commit 121a736

Please sign in to comment.