permissionsChanged

When a user gives/revokes your broadcast or screenshare permissions, then the permissionsChanged event will be emitted. Such users are typically moderators who are capable of managing other users' permissions.

Typical use-case for listening to this event is to show camera and microphone icons in your custom toolbar when the user receives permissions to broadcast.

Sample payload

{
    "type": "permissionsChanged",
    "data": {
        "broadcast": true,
        "screenshare": true
    }
}

Sample subscription code

sambaFrame.on('permissionsChanged', (event) => {
  const data = event.data;
  
  if (data.broadcast !== undefined) {
    if (data.broadcast) {
      console.log('You were granted broadcast permission')
    } else {
      console.log('Your permission to broadcast was revoked')
    }
  }

  if (data.screenshare !== undefined) {
    if (data.screenshare) {
      console.log('You were granted screenshare permission')
    } else {
      console.log('Your permission to screenshare was revoked')
    }
  }
});

Last updated