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 DyteStageStatus 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.
  • REJECTED_TO_JOIN_STAGE: Indicates that the host has rejected the user's request to join the stage. The user can request again to join from this status.

The meeting.stage.status 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 DyteJoinedMeetingParticipant 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.addStageEventsListener(object : DyteStageEventListener {
override fun onPresentRequestReceived() {
// Called when the local user's stage access request is accepted by the host,
// or when the local user, who is a viewer, is invited to the stage by the host.
}

override fun onAddedToStage() {
// Called when the local user successfully joins the stage.
}

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

override fun onPresentRequestAdded(participant: DyteJoinedMeetingParticipant) {
// Called when a participant requests to join the stage. Triggered only if the local user is a host.
}

override fun onPresentRequestClosed(participant: DyteJoinedMeetingParticipant) {
// Called when a participant with a pending stage access request leaves the meeting.
// Triggered only if the local user is a host.
}

override fun onPresentRequestRejected(participant: DyteJoinedMeetingParticipant) {
// Called when a participant's stage access request is denied by the host.
// Triggered only if the local user is a host.
}

override fun onPresentRequestWithdrawn(participant: DyteJoinedMeetingParticipant) {
// Called when a participant cancels their stage access request.
// Triggered only if the local user is a host.
}

override fun onParticipantRemovedFromStage(participant: DyteJoinedMeetingParticipant) {
// Called when a participant is removed from the stage by the host.
}

override fun onStageRequestsUpdated(accessRequests: List<DyteJoinedMeetingParticipant>) {
// Called when the list of stage access requests is updated.
}

override fun onParticipantStartedPresenting(participant: DyteJoinedMeetingParticipant) {
// Called when a participant joins the stage.
}

override fun onParticipantStoppedPresenting(participant: DyteJoinedMeetingParticipant) {
// Called when a participant leaves the stage.
}

override fun onStageStatusUpdated(stageStatus: DyteStageStatus) {
// Called when the local user's stage status is updated.
}
})

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