Skip to content

Commit 04d74b0

Browse files
committed
fix: add disconnected in roomstate
1 parent 1a98446 commit 04d74b0

File tree

4 files changed

+37
-39
lines changed

4 files changed

+37
-39
lines changed

docs/react-web-core/local-user/events.mdx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -118,24 +118,6 @@ meeting.self.on('mediaScoreUpdate', ({ kind, isScreenshare, score }) => {
118118
});
119119
```
120120

121-
## Webinar Stage events
122-
123-
In a `WEBINAR` setup, below events can be used to bring a user on to stage
124-
125-
| **Event** | **Description** |
126-
| -------------------------- | ---------------------------------------------------------------------------------------- |
127-
| `waitlisted` | Emitted when the user has been added to the waitlist. |
128-
| `joinStageRequestAccepted` | Emitted to all host users, when a host accepts a user's request to join webinar meeting. |
129-
| `joinStageRequestRejected` | Emitted to all host users, when a host rejects a user's request to join webinar meeting. |
130-
| `removedFromStage` | Emitted when the user has been kicked from the webinar meeting. |
131-
| `stageJoined` | Emitted when the user has joined the webinar meeting. |
132-
| `stageLeft` | Emitted when the user has left the webinar meeting. |
133-
| `peerRequestToJoinStage` | Emitted when a user has requested to join the webinar meeting. |
134-
| `peerRejectedToJoinStage` | Emitted when the user's request to join the meeting has been rejected. |
135-
| `peerAcceptedToJoinStage` | Emitted when the user's request to join the meeting has been accepted |
136-
| `peerStoppedPresenting` | Emitted when a participant stops presenting in the webinar meeting. |
137-
| `peerStartedPresenting` | Emitted when a participant starts presenting in the webinar meeting. |
138-
139121
## Permission Updates
140122

141123
Triggered when permissions are updated dynamically by a privileged user

docs/react-web-core/local-user/introduction.mdx

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,46 @@ Here is a list of properties that local user provides:
5050
"accepted" | "waiting" | "rejected" | "none"
5151
```
5252

53+
- `isPinned`: A boolean value indicating if the local user is pinned or not.
5354
- `roomJoined`: A boolean value indicating if the local user is in the meeting
5455
- `roomState`: Indicates the state of the user in the meeting. It
5556
can take the following values:
5657

5758
```ts
58-
"init" | "joined" | "waitlisted" | "rejected" | "kicked" | "left" | "ended"
59+
"init" | "joined" | "waitlisted" | "rejected" | "kicked" | "left" | "ended" | "disconnected"
5960
```
60-
- `isPinned`: A boolean value indicating if the local user is pinned or not.
61+
62+
```mermaid
63+
stateDiagram-v2
64+
direction LR
65+
classDef END fill:#ef4444,color:#fff,stroke:#ef4444;
66+
67+
[*] --> init
68+
init --> joined
69+
init --> waitlisted
70+
waitlisted --> joined
71+
waitlisted --> rejected
72+
joined --> disconnected
73+
disconnected --> joined
74+
joined --> kicked
75+
joined --> left
76+
joined --> ended
77+
78+
class kicked,left,ended,rejected END
79+
```
80+
81+
```ts
82+
// subscribe to roomState
83+
const roomState = useDyteSelector((m) => m.self.roomState)
84+
85+
return (
86+
<>
87+
{roomState === "disconnected" && <div>disconnected</div>}
88+
</>
89+
)
90+
```
91+
92+
6193

6294

6395
## Change the name of the local user

docs/web-core/local-user/events.mdx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -157,24 +157,6 @@ meeting.self.on('mediaScoreUpdate', ({ kind, isScreenshare, score }) => {
157157
});
158158
```
159159

160-
## Webinar Stage events
161-
162-
In a `WEBINAR` setup, below events can be used to bring a user on to stage
163-
164-
| **Event** | **Description** |
165-
| -------------------------- | ---------------------------------------------------------------------------------------- |
166-
| `waitlisted` | Emitted when the user has been added to the waitlist. |
167-
| `joinStageRequestAccepted` | Emitted to all host users, when a host accepts a user's request to join webinar meeting. |
168-
| `joinStageRequestRejected` | Emitted to all host users, when a host rejects a user's request to join webinar meeting. |
169-
| `removedFromStage` | Emitted when the user has been kicked from the webinar meeting. |
170-
| `stageJoined` | Emitted when the user has joined the webinar meeting. |
171-
| `stageLeft` | Emitted when the user has left the webinar meeting. |
172-
| `peerRequestToJoinStage` | Emitted when a user has requested to join the webinar meeting. |
173-
| `peerRejectedToJoinStage` | Emitted when the user's request to join the meeting has been rejected. |
174-
| `peerAcceptedToJoinStage` | Emitted when the user's request to join the meeting has been accepted |
175-
| `peerStoppedPresenting` | Emitted when a participant stops presenting in the webinar meeting. |
176-
| `peerStartedPresenting` | Emitted when a participant starts presenting in the webinar meeting. |
177-
178160
<head>
179161
<title>Web Core Events</title>
180162
</head>

docs/web-core/local-user/introduction.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Here is a list of properties that local user provides:
4747
can take the following values:
4848

4949
```ts
50-
"init" | "joined" | "waitlisted" | "rejected" | "kicked" | "left" | "ended"
50+
"init" | "joined" | "waitlisted" | "rejected" | "kicked" | "left" | "ended" | "disconnected"
5151
```
5252

5353
```mermaid
@@ -60,6 +60,8 @@ stateDiagram-v2
6060
init --> waitlisted
6161
waitlisted --> joined
6262
waitlisted --> rejected
63+
joined --> disconnected
64+
disconnected --> joined
6365
joined --> kicked
6466
joined --> left
6567
joined --> ended

0 commit comments

Comments
 (0)