setTrackSubscriptionPermissions method

void setTrackSubscriptionPermissions(
  1. {required bool allParticipantsAllowed,
  2. List<ParticipantTrackPermission> trackPermissions = const []}
)

Control who can subscribe to LocalParticipant's published tracks.

By default, all participants can subscribe. This allows fine-grained control over who is able to subscribe at a participant and track level.

Note: if access is given at a track-level (i.e. both allParticipantsAllowed and ParticipantTrackPermission.allTracksAllowed are false), any newer published tracks will not grant permissions to any participants and will require a subsequent permissions update to allow subscription.

allParticipantsAllowed Allows all participants to subscribe all tracks. Takes precedence over trackPermissions if set to true. By default this is set to true.

trackPermissions Full list of individual permissions per participant/track. Any omitted participants will not receive any permissions.

Implementation

void setTrackSubscriptionPermissions({
  required bool allParticipantsAllowed,
  List<ParticipantTrackPermission> trackPermissions = const [],
}) {
  _allParticipantsAllowed = allParticipantsAllowed;
  _participantTrackPermissions = trackPermissions;
  sendTrackSubscriptionPermissions();
}