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, RealtimeKit 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
RealtimeKit'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:
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.
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 RtkRemoteParticipant
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
).
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 RtkStageEventListener
interface provides callback methods for various stage events. Implement these callbacks to handle stage-related events in your application:
class StageEventListener extends RtkStageEventListener {
void onStageAccessRequestAccepted() {
// Called when the local user is accepted to join the stage.
}
void onStageAccessRequestRejected() {
// Called when the local user's request to join the stage is rejected by the host.
}
void onStageAccessRequestsUpdated(List<RtkRemoteParticipant> accessRequests) {
// Called when the list of stage access requests is updated, only if the local user is a host.
}
void onNewStageAccessRequest(RtkRemoteParticipant participant) {
// Called when a new stage access request is received from a participant, only if the local user is a host.
}
void onPeerStageStatusUpdated(
RtkRemoteParticipant participant,
StageStatus oldStatus,
StageStatus newStatus
) {
// Called when a remote participant's stage status is updated.
}
void onRemovedFromStage() {
// Called when the local user is removed from the stage.
}
void onStageStatusUpdated(StageStatus oldStatus, StageStatus newStatus) {
// Called when the local user's stage status is updated.
}
}
You need to attach the listener to meeting client as follows:
meeting.addStageEventListener(StageEventListener())
Next, we'll explore the Stage Management APIs for hosts, allowing them to manage stage requests, participants in RealtimeKit meetings.