Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add a note about participant list truncation and livestreaming use case #1559

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading