Skip to content

Commit f1c635c

Browse files
committed
chore(android-core): update stage docs with v2 changes
1 parent 353ef32 commit f1c635c

File tree

3 files changed

+58
-86
lines changed

3 files changed

+58
-86
lines changed

docs/android-core/stage-management/1-introduction.mdx

+36-49
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ tags:
99

1010
_Below documentation is relevant for Interactive Livestream(LHLS) and Webinar(WebRTC) use cases._
1111

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

1717
### Accessing the Stage APIs
@@ -21,27 +21,25 @@ permissions, and kicking participants from the stage. These APIs are accessible
2121

2222
### Stage Status
2323

24-
In meetings where stage management is enabled, a user's stage status can change within the values represented by the `DyteStageStatus`
24+
In meetings where stage management is enabled, a user's stage status can change within the values represented by the `StageStatus`
2525
enum. These status values include:
2626

2727
- `ON_STAGE`: Indicates that the user is currently on the stage and is allowed to publish media.
2828
- `OFF_STAGE`: Indicates that the user is a viewer and is not on the stage. They can see and listen to those on stage.
29-
- `REQUESTED_TO_JOIN_STAGE`: Indicates that the user has a pending request to join the stage. This status is assigned to the user
29+
- `REQUESTED_TO_JOIN_STAGE`: Indicates that the user has a pending request to join the stage. This status is assigned to the user
3030
until the host accepts or rejects their request.
3131
- `ACCEPTED_TO_JOIN_STAGE`: Indicates that the host has accepted the user's request to join the stage.
32-
- `REJECTED_TO_JOIN_STAGE`: Indicates that the host has rejected the user's request to join the stage. The user can request again
33-
to join from this status.
3432

35-
The `meeting.stage.status` property provides the current stage status of the local user.
33+
The `meeting.stage.stageStatus` property provides the current stage status of the local user.
3634

3735
### Viewers
3836

39-
You can retrieve a list of off-stage participants (viewers) in a stage-enabled meeting by accessing the `meeting.stage.viewers`
40-
property. This property provides a list of `DyteJoinedMeetingParticipant` objects whose stage status is not `ON_STAGE`.
37+
You can retrieve a list of off-stage participants (viewers) in a stage-enabled meeting by accessing the `meeting.stage.viewers`
38+
property. This property provides a list of `DyteRemoteParticipant` objects whose stage status is not `ON_STAGE`.
4139

4240
### Joining the Stage
4341

44-
To interact with peers and publish media, users can join the stage. This action is only possible if the user's preset allows them
42+
To interact with peers and publish media, users can join the stage. This action is only possible if the user's preset allows them
4543
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`).
4644

4745
```kotlin
@@ -50,73 +48,62 @@ meeting.stage.join()
5048

5149
### Leaving the Stage
5250

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

5654
```kotlin
5755
meeting.stage.leave()
5856
```
5957

58+
## Error types
59+
60+
All the stage management APIs can throw an error of type `StageError`. The error type can be one of the following:
61+
62+
- StageDisabledForMeetingType: The meeting type does not support stage management.
63+
- PermissionDenied: The user does not have the required permissions to perform the operation.
64+
- ActionInvalidForStageStatus: The operation is invalid for the current stage status.
65+
- NoRequestToCancel: There is no pending request to cancel.
66+
6067
### List of Stage Events
6168

62-
The `DyteStageEventListener` interface provides callback methods for various stage events. Implement these callbacks to handle
69+
The `DyteStageEventListener` interface provides callback methods for various stage events. Implement these callbacks to handle
6370
stage-related events in your application:
6471

6572
```kotlin
6673
meeting.addStageEventsListener(object : DyteStageEventListener {
67-
override fun onPresentRequestReceived() {
68-
// Called when the local user's stage access request is accepted by the host,
69-
// or when the local user, who is a viewer, is invited to the stage by the host.
74+
override fun onStageAccessRequestAccepted() {
75+
// Called when the local user is accepted to join the stage.
7076
}
7177

72-
override fun onAddedToStage() {
73-
// Called when the local user successfully joins the stage.
78+
override fun onStageAccessRequestRejected() {
79+
// Called when the local user's request to join the stage is rejected by the host.
7480
}
7581

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

80-
override fun onPresentRequestAdded(participant: DyteJoinedMeetingParticipant) {
81-
// Called when a participant requests to join the stage. Triggered only if the local user is a host.
82-
}
83-
84-
override fun onPresentRequestClosed(participant: DyteJoinedMeetingParticipant) {
85-
// Called when a participant with a pending stage access request leaves the meeting.
86-
// Triggered only if the local user is a host.
87-
}
88-
89-
override fun onPresentRequestRejected(participant: DyteJoinedMeetingParticipant) {
90-
// Called when a participant's stage access request is denied by the host.
91-
// Triggered only if the local user is a host.
92-
}
93-
94-
override fun onPresentRequestWithdrawn(participant: DyteJoinedMeetingParticipant) {
95-
// Called when a participant cancels their stage access request.
96-
// Triggered only if the local user is a host.
97-
}
98-
99-
override fun onParticipantRemovedFromStage(participant: DyteJoinedMeetingParticipant) {
100-
// Called when a participant is removed from the stage by the host.
86+
override fun onNewStageAccessRequest(participant: DyteRemoteParticipant) {
87+
// Called when a new stage access request is received from a participant.
10188
}
10289

103-
override fun onStageRequestsUpdated(accessRequests: List<DyteJoinedMeetingParticipant>) {
90+
override fun onStageAccessRequestsUpdated(accessRequests: List<DyteRemoteParticipant>) {
10491
// Called when the list of stage access requests is updated.
10592
}
10693

107-
override fun onParticipantStartedPresenting(participant: DyteJoinedMeetingParticipant) {
108-
// Called when a participant joins the stage.
109-
}
110-
111-
override fun onParticipantStoppedPresenting(participant: DyteJoinedMeetingParticipant) {
112-
// Called when a participant leaves the stage.
94+
override fun onStageStatusUpdated(oldStatus: StageStatus, newStatus: StageStatus) {}
95+
// Called when the local user's stage status is updated.
11396
}
11497

115-
override fun onStageStatusUpdated(stageStatus: DyteStageStatus) {
116-
// Called when the local user's stage status is updated.
98+
override fun onPeerStageStatusUpdated(
99+
participant: DyteRemoteParticipant,
100+
oldStatus: StageStatus,
101+
newStatus: StageStatus,
102+
) {
103+
// Called when a participant's stage status is updated.
117104
}
118105
})
119-
```
106+
```
120107

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

docs/android-core/stage-management/2-host-controls.mdx

+18-33
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,42 @@ tags:
77
- stage
88
---
99

10-
In a stage management-enabled meeting, a user with the `selfPermissions.host.canAcceptStageRequests` permission as `true` is
11-
considered a host. The `meeting.stage` object in Dyte's Android Core SDK provides stage management APIs that allow hosts to
10+
In a stage management-enabled meeting, a user with the `permissions.host.canAcceptStageRequests` permission as `true` is
11+
considered a host. The `meeting.stage` object in Dyte's Android Core SDK provides stage management APIs that allow hosts to
1212
manage stage access requests, invite participants to the stage, and remove participants from the stage.
1313

1414
### List of Stage Access Requests
1515

16-
You can retrieve the list of pending stage access requests by accessing the `meeting.stage.accessRequests` property. This property
17-
provides a list of `DyteJoinedMeetingParticipant` objects who have requested stage access.
16+
You can retrieve the list of pending stage access requests by accessing the `meeting.stage.accessRequests` property. This property
17+
provides a list of `DyteRemoteParticipant` objects who have requested stage access.
1818

1919
**Note**: If the local user is not a host, this property returns an empty list.
2020

2121
### Grant Access
2222

23-
To accept stage access requests or allow a participant directly to the stage, you can use the `grantAccess()` method.
24-
Alternatively, the `grantAccessAll()` method can be used to grant stage access to all participants with pending stage access requests.
23+
To accept stage access requests or allow a participant directly to the stage, you can use the `grantAccess()` method.
2524

2625
```kotlin
2726
// Grants stage access to a participant
2827
// id: peer id of the stage access requesting participant
29-
meeting.stage.grantAccess(id)
28+
meeting.stage.grantAccess(listOf(id))
3029

31-
// Grants stage access to all participants with pending stage access requests
32-
meeting.stage.grantAccessAll()
30+
// Grants stage access to all pending stage access requests
31+
meeting.stage.grantAccess(meeting.stage.accessRequests.map { it.userId })
3332
```
3433

3534
### Deny Access
3635

37-
To reject stage access requests, you can use the `denyAccess()` method. Similarly, the `denyAccessAll()` method can be used to
36+
To reject stage access requests, you can use the `denyAccess()` method. Similarly, the `denyAccessAll()` method can be used to
3837
deny all pending stage access requests.
3938

4039
```kotlin
4140
// Denies stage access request of a participant
4241
// id: peer id of the stage access requesting participant
43-
meeting.stage.denyAccess(id)
42+
meeting.stage.denyAccess(listOf(id))
4443

4544
// Denies all pending stage access requests
46-
meeting.stage.denyAccessAll()
45+
meeting.stage.denyAccess(meeting.stage.accessRequests.map { it.userId })
4746
```
4847

4948
### Kick Users
@@ -53,39 +52,25 @@ You can remove a participant from the stage by using the `kick()` method.
5352
```kotlin
5453
// Kicks a participant from stage
5554
// id: peer id of the ON_STAGE participant to kick
56-
meeting.stage.kick(id)
55+
meeting.stage.kick(listOf(id))
5756
```
5857

5958
### Listening to Stage Access Requests
6059

61-
You can listen to incoming stage access requests or changes in the access requests list if you are a host. The SDK provides the
60+
You can listen to incoming stage access requests or changes in the access requests list if you are a host. The SDK provides the
6261
following callbacks to `DyteStageEventsListener`:
6362

6463
```kotlin
6564
meeting.addStageEventsListener(object : DyteStageEventsListener {
66-
override fun onPresentRequestAdded(participant: DyteStageParticipant) {
67-
// Called when a user is requesting to join the stage
65+
override fun onNewStageAccessRequest(participant: DyteRemoteParticipant) {
66+
// Called when a new stage access request is received from a participant.
6867
}
6968

70-
override fun onPresentRequestClosed(participant: DyteStageParticipant) {
71-
// Called when a user who was trying to join the stage leaves the call
72-
}
73-
74-
override fun onPresentRequestRejected(participant: DyteStageParticipant) {
75-
// Called when a join stage request is denied by the host
76-
}
77-
78-
override fun onPresentRequestWithdrawn(participant: DyteStageParticipant) {
79-
// Called when a user who was trying to join the stage withdraws their request to join
80-
}
81-
82-
override fun onStageRequestsUpdated(accessRequests: List<DyteJoinedMeetingParticipant>) {
83-
// Called when the access requests list is updated
69+
override fun onStageAccessRequestsUpdated(accessRequests: List<DyteRemoteParticipant>) {
70+
// Called when the list of stage access requests is updated.
8471
}
8572
})
8673
```
8774

88-
These APIs enable you to manage stage access requests and participants effectively in Dyte meetings. Next, we'll explore the
75+
These APIs enable you to manage stage access requests and participants effectively in Dyte meetings. Next, we'll explore the
8976
Stage APIs available to Viewer participants.
90-
91-

docs/android-core/stage-management/3-viewer-participants.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tags:
77
- stage
88
---
99

10-
Viewer participants in a stage-enabled meeting are users whose preset permission for media production is set as `CAN_REQUEST`.
10+
Viewer participants in a stage-enabled meeting are users whose preset permission for media production is set as `CAN_REQUEST`.
1111
The `meeting.stage` object provides APIs for viewer participants to request stage access and withdraw their join stage request.
1212

1313
### Request Access
@@ -18,12 +18,12 @@ To request access to the stage, you can call the `requestAccess()` method:
1818
meeting.stage.requestAccess()
1919
```
2020

21-
When a host accepts the user's stage access request or allows the user directly to the stage, the SDK triggers the
22-
`onPresentRequestReceived` callback in `DyteStageEventListener`. You can listen to this event:
21+
When a host accepts the user's stage access request or allows the user directly to the stage, the SDK triggers the
22+
`onStageAccessRequestAccepted` callback in `DyteStageEventListener`. You can listen to this event:
2323

2424
```kotlin
2525
meeting.addStageEventsListener(object : DyteStageEventListener {
26-
override fun onPresentRequestReceived() {
26+
override fun onStageAccessRequestAccepted() {
2727
// Host accepted the join stage request or invited user directly to stage
2828
}
2929
})

0 commit comments

Comments
 (0)