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 dyteMobileClient.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:
onStage
: Indicates that the user is currently on the stage and is allowed to publish media.offStage
: Indicates that the user is a viewer and is not on the stage. They can see and listen to those on stage.requestedToJoinStage
: 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.acceptedToJoinStage
: Indicates that the host has accepted the user's request to join the stage.rejectedToJoinStage
: 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 dyteMobileClient.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 onStage
.
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 acceptedToJoinStage
).
dyteClient.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.
dyteClient.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:
class StageEventListener extends DyteStageEventsListener {
void onAddedToStage() {
// Called when the local user successfully joins the stage.
}
void onParticipantRemovedFromStage(
DyteJoinedMeetingParticipant participant) {
// Called when a participant is removed from the stage by the host.
}
void onPresentRequestAdded(DyteJoinedMeetingParticipant participant) {
// Called when a participant requests to join the stage. Triggered only if the local user is a host.
}
void onPresentRequestClosed(DyteJoinedMeetingParticipant participant) {
// Called when a participant with a pending stage access request leaves the meeting.
// Triggered only if the local user is a host.
}
void 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.
}
void onPresentRequestRejected(DyteJoinedMeetingParticipant participant) {
// Called when a participant's stage access request is denied by the host.
// Triggered only if the local user is a host.
}
void onPresentRequestWithdrawn(DyteJoinedMeetingParticipant participant) {
// Called when a participant cancels their stage access request.
// Triggered only if the local user is a host.
}
void onRemovedFromStage() {
// Called when the local user is removed from the stage.
}
void onStageRequestsUpdated(List<DyteJoinedMeetingParticipant> accessRequests) {
// Called when the list of stage access requests is updated.
}
void onStageStatusUpdated(DyteStageStatus stageStatus) {
// Called when the local user's stage status is updated.
}
void onParticipantStartedPresenting(DyteJoinedMeetingParticipant participant) {
// Called when a participant joins the stage.
}
void onParticipantStoppedPresenting(DyteJoinedMeetingParticipant participant) {
// Called when a participant leaves the stage.
}
}
You need to attach the listener to meeting client as follows:
dyteClient.addStageEventsListener(StageEventsListener())
Next, we'll explore the Stage Management APIs for hosts, allowing them to manage stage requests, participants in Dyte meetings.