Pinning Users

The StreamVideo SDK has support for pinning users, both locally for the current user, and remotely for everyone in the call.

Every user can pin as many participants on the call as they want, and those users will be shown first in the list of participants for that user. Pinning someone for everyone in the call requires the pinForEveryone capability.

By default, the pinned users appear first on the participants array. The ones which are pinned remotely appear before the local ones. If there are several remotely pinned users, they are sorted by the pinning date (the most recent pins appear first). You can change this sorting behaviour with your own implementation.

Local pins

In order to pin a user locally, you should call the following method on the Call object:

call.setParticipantPinnedLocally(sessionId: 'pinned_user_session_id', userId: 'pinned_user_id', pinned: true);

To unpin the user:

call.setParticipantPinnedLocally(sessionId: 'pinned_user_session_id', userId: 'pinned_user_id', pinned: false);

Remote pins

If you want to pin a user for everyone in the call, you should use the following method:

final response = await call.setParticipantPinnedForEveryone(sessionId: 'pinned_user_session_id', userId: 'pinned_user_id', pinned: true)

Similarly, to unpin a user:

final response = await call.setParticipantPinnedForEveryone(sessionId: 'pinned_user_session_id', userId: 'pinned_user_id', pinned: false)
© Getstream.io, Inc. All Rights Reserved.