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

Pinned changed event #174

Merged
merged 2 commits into from
Jul 28, 2023
Merged

Pinned changed event #174

merged 2 commits into from
Jul 28, 2023

Conversation

tbarbugli
Copy link
Member

Introduce an SFU event to notify when the list of pinned session has changed, the same information is also returned when joining the call as part of the JoinResponse

// pinned_sessions contains the list of sessions that are pinned
// in the call. The order of the sessions in the list is the order
// in which they are pinned (descending order of priority).
repeated string pinned_sessions = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we call it pinned_user_ids?
remote rpc calls are never session aware so this term is confusing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not an rpc between coordinator and SFU, this is the event from SFU to clients

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and we need to specify the session_id because a user can be connected multiple times/have multiple tracks

@tbarbugli tbarbugli requested a review from thesyncim July 28, 2023 14:57
@tbarbugli tbarbugli merged commit 3428b25 into main Jul 28, 2023
4 checks passed
@tbarbugli tbarbugli deleted the pinned_video branch July 28, 2023 19:46
oliverlaz added a commit to GetStream/stream-video-js that referenced this pull request Aug 7, 2023
Adds support for Server-Side participant pinning.

Reference: GetStream/chat#5239,
GetStream/protocol#174
Specs:
https://www.notion.so/stream-wiki/Video-Pinning-2b348a962da742389f734b7fd9b1cf46

## Breaking changes
This PR brings a small breaking change in the participant pinning API.
Previously, we used to have `call.setParticipantPinnedAt` API which is
now replaced with `call.pin(sessionId)` and `call.unpin(sessionId)`
APIs.

Additionally, the `participant.pinnedAt` property has been replaced with
a new `pin` structure of this shape:
```
const participant = {
  ...,
  pin: {
    isLocal: boolean, // set to `true` when this participant is server-side pinned
    pinnedAt: number, // a timestamp, shows when "pinning" happened
  }
}
```

---------

Co-authored-by: Khushal Agarwal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants