Skip to main content

Stage management

Access the stage APIs

Stage feature is useful when you're using webinar/livestream. We allow central stage methods for both call types.

Using Dyte's stage management APIs a user can do actions such as request to join, join/leave stage, grant/deny stage access to other users, etc.

All stage APIs are accessible by following excerpt:

final stage = dyteClient.stage;

Properties

Status

The following method returns the current stage status of the local user.

final DyteStageStatus stageStatus = dyteClient.stage.status;

It can have the following values:

  • DyteStageStatus.onStage : This value indicates that the user is currently on the stage.
  • DyteStageStatus.offStage : This value means that the user is viewing the webinar/livestream but is not on the stage.
  • DyteStageStatus.requestedToJoinStage : The user has a pending request to join stage. This value will be assigned to their status until the host accepts or rejects their request.
  • DyteStageStatus.acceptedToJoinStage : The host has accepted user's request to join stage. If the host accepts the user's request to join the stage, this value will be assigned to the user's status.

Host Controls

Note

These methods are preset dependent, hence if a user's preset doesn't allow certain host actions, calling the API won't change anything.

Dyte's stage management APIs allow hosts to receive and manage stage requests as well as leave and join the stage.

Join stage

This method enables the user to be on stage and let them interact with other peers in the meeting.

dyteClient.stage.join();

Leave stage

This method lets user leave the stage and. Additionally, their audio/video will no longet be visible to others in the room.

dyteClient.stage.leave();

Grant stage access

A privileged user can grant access to stage for a set of users with grantAccess method.

ParametersType
peerDyteJoinedMeetingParticipant
dyteClient.stage.grantAccess(peer);

To grant access to all stage requests at a time, you can user grantAccessToAll() method. This method takes no parameters.

dyteClient.stage.grantAccessToAll();

Deny stage access

A privileged user can deny access to stage for a set of users with denyAccess method.

ParametersType
peerDyteJoinedMeetingParticipant
dyteClient.stage.denyAccess(peer);

To deny all stage requests at a time, you can user denyAccessToAll() method. This method takes no parameters.

dyteClient.stage.denyAccessToAll();

Kick participant from stage

A privileged user can kick a participant from stage with kick method.

ParametersType
peerDyteJoinedMeetingParticipant
dyteClient.stage.kick(peer);

Participant controls

Dyte's stage management APIs allow participant to receive and manage stage requests as well as leave and join the stage.

Request access

This method is used to create a new stage request which can be approved by the host.

dyteClient.stage.requestAccess();

Withdraw join request

You can call this method in order to cancel your stage request.

dyteClient.stage.withdrawJoinRequest();

Stage Events

To be able to listen to stage events, you need to attach a stage events listener as:

class StageEventListener extends DyteStageEventsListener {
...


void onStageStatusUpdated(DyteStageStatus status) {
// Update your UI as per this stage status.
}
...
}
dyteClient.addStageEventsListener(StageEventsListener())

When the stage status of local user is updated, this event is triggered. It contains updated stage status as an argument.


void onStageStatusUpdated(DyteStageStatus status){
// Update your UI/ manage you state as per this stage status.
}

Here are a list of events the stage occurs:

EventDescription
onStageRequestsUpdatedEmitted when stageRequests changes. This event also contain a list of updated requests in the payload as accessRequests
onStageStatusUpdatedEmitted when the user's stage status changes. It contains the updated stage status in the payload as stageStatus.
onParticipantRemovedFromStageEmitted when a participant is removed from stage. It contains the participant that is removed in the payload as participant