9
9
10
10
_ Below documentation is relevant for Interactive Livestream(LHLS) and Webinar(WebRTC) use cases._
11
11
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
15
15
choose to grant or deny.
16
16
17
17
### Accessing the Stage APIs
@@ -21,27 +21,25 @@ permissions, and kicking participants from the stage. These APIs are accessible
21
21
22
22
### Stage Status
23
23
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 `
25
25
enum. These status values include:
26
26
27
27
- ` ON_STAGE ` : Indicates that the user is currently on the stage and is allowed to publish media.
28
28
- ` 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
30
30
until the host accepts or rejects their request.
31
31
- ` 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.
34
32
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.
36
34
37
35
### Viewers
38
36
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 ` .
41
39
42
40
### Joining the Stage
43
41
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
45
43
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 ` ).
46
44
47
45
``` kotlin
@@ -50,73 +48,62 @@ meeting.stage.join()
50
48
51
49
### Leaving the Stage
52
50
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,
54
52
and their audio and video are no longer received by others in the room.
55
53
56
54
``` kotlin
57
55
meeting.stage.leave()
58
56
```
59
57
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
+
60
67
### List of Stage Events
61
68
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
63
70
stage-related events in your application:
64
71
65
72
``` kotlin
66
73
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.
70
76
}
71
77
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 .
74
80
}
75
81
76
82
override fun onRemovedFromStage () {
77
83
// Called when the local user is removed from the stage.
78
84
}
79
85
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.
101
88
}
102
89
103
- override fun onStageRequestsUpdated (accessRequests : List <DyteJoinedMeetingParticipant >) {
90
+ override fun onStageAccessRequestsUpdated (accessRequests : List <DyteRemoteParticipant >) {
104
91
// Called when the list of stage access requests is updated.
105
92
}
106
93
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.
113
96
}
114
97
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.
117
104
}
118
105
})
119
- ```
106
+ ```
120
107
121
108
Next, we'll explore the Stage Management APIs for hosts, allowing them to manage stage requests, participants in Dyte meetings.
122
109
0 commit comments