Stage Host Controls
In a stage management-enabled meeting, a user with the permissions.host.canAcceptStageRequests
permission as true
is
considered a host. The meeting.stage
object in Dyte's Android Core SDK provides stage management APIs that allow hosts to
manage stage access requests, invite participants to the stage, and remove participants from the stage.
List of Stage Access Requests
You can retrieve the list of pending stage access requests by accessing the meeting.stage.accessRequests
property. This property
provides a list of DyteRemoteParticipant
objects who have requested stage access.
Note: If the local user is not a host, this property returns an empty list.
Grant Access
To accept stage access requests or allow a participant directly to the stage, you can use the grantAccess()
method.
// Grants stage access to a participant
// id: peer id of the stage access requesting participant
meeting.stage.grantAccess(listOf(id))
// Grants stage access to all pending stage access requests
meeting.stage.grantAccess(meeting.stage.accessRequests.map { it.userId })
Deny Access
To reject stage access requests, you can use the denyAccess()
method.
// Denies stage access request of a participant
// id: peer id of the stage access requesting participant
meeting.stage.denyAccess(listOf(id))
// Denies all pending stage access requests
meeting.stage.denyAccess(meeting.stage.accessRequests.map { it.userId })
Kick Users
You can remove a participant from the stage by using the kick()
method.
// Kicks a participant from stage
// id: peer id of the ON_STAGE participant to kick
meeting.stage.kick(listOf(id))
Listening to Stage Access Requests
You can listen to incoming stage access requests or changes in the access requests list if you are a host. The SDK provides the
following callbacks to DyteStageEventListener
:
meeting.addStageEventListener(object : DyteStageEventListener {
override fun onNewStageAccessRequest(participant: DyteRemoteParticipant) {
// Called when a new stage access request is received from a participant.
}
override fun onStageAccessRequestsUpdated(accessRequests: List<DyteRemoteParticipant>) {
// Called when the list of stage access requests is updated.
}
})
These APIs enable you to manage stage access requests and participants effectively in Dyte meetings. Next, we'll explore the Stage APIs available to Viewer participants.