Skip to main content

Introduction

Below documentation is relevant for Interactive Livestream(LHLS) and Webinar(WebRTC) use cases.

Instead of a traditional publish-subscribe model, where a user can publish their media and others can choose to subscribe, Dyte comes with an optional managed configuration. In this managed configuration, a less privileged user can be configured with a default behavior to not publish media. The user can then request permission to publish their media, which a privileged user can choose to grant or deny.

Accessing the Stage APIs

Dyte's stage management APIs allow users to perform actions such as joining and leaving the stage, managing stage requests and permissions, and kicking participants from the stage. These APIs are accessible through the meeting.stage object.

Stage Status

In meetings where stage management is enabled, a user's stage status can change within the values represented by the StageStatus enum. These status values include:

  • ON_STAGE: Indicates that the user is currently on the stage and is allowed to publish media.
  • OFF_STAGE: Indicates that the user is a viewer and is not on the stage. They can see and listen to those on stage.
  • REQUESTED_TO_JOIN_STAGE: Indicates that the user has a pending request to join the stage. This status is assigned to the user until the host accepts or rejects their request.
  • ACCEPTED_TO_JOIN_STAGE: Indicates that the host has accepted the user's request to join the stage.

The meeting.stage.stageStatus property provides the current stage status of the local user.

Viewers

You can retrieve a list of off-stage participants (viewers) in a stage-enabled meeting by accessing the meeting.stage.viewers property. This property provides a list of DyteRemoteParticipant objects whose stage status is not ON_STAGE.

Joining the Stage

To interact with peers and publish media, users can join the stage. This action is only possible if the user's preset allows them to publish media or if their request to join the stage has been accepted by a host (i.e., their stage status is ACCEPTED_TO_JOIN_STAGE).

meeting.stage.join()

Leaving the Stage

When users want to stop interacting with peers, they can leave the stage. This action stops their media from being published, and their audio and video are no longer received by others in the room.

meeting.stage.leave()

List of Stage Events

The DyteStageEventListener interface provides callback methods for various stage events. Implement these callbacks to handle stage-related events in your application:

meeting.addStageEventListener(object : DyteStageEventListener {
override fun onStageAccessRequestAccepted() {
// Called when the local user is accepted to join the stage.
}

override fun onStageAccessRequestRejected() {
// Called when the local user's request to join the stage is rejected by the host.
}

override fun onRemovedFromStage() {
// Called when the local user is removed from the stage.
}

override fun onNewStageAccessRequest(participant: DyteRemoteParticipant) {
// Called when a new stage access request is received from a participant.
// Triggered only if the local user is a host.
}

override fun onStageAccessRequestsUpdated(accessRequests: List<DyteRemoteParticipant>) {
// Called when the list of stage access requests is updated.
// Triggered only if the local user is a host.
}

override fun onStageStatusUpdated(oldStatus: StageStatus, newStatus: StageStatus) {}
// Called when the local user's stage status is updated.
}

override fun onPeerStageStatusUpdated(
participant: DyteRemoteParticipant,
oldStatus: StageStatus,
newStatus: StageStatus,
) {
// Called when a remote participant's stage status is updated.
}
})

Stage Errors

All the stage management APIs return a StageError if the operation fails. On success, they return null. The error type can be one of the following:

  • StageDisabledForMeetingType: The meeting type does not support stage management.
  • PermissionDenied: The user does not have the required permissions to perform the operation.
  • ActionInvalidForStageStatus: The operation is invalid for the current stage status.
  • NoRequestToCancel: There is no pending request to cancel.

Next, we'll explore the Stage Management APIs for hosts, allowing them to manage stage requests, participants in Dyte meetings.