Skip to content

Commit

Permalink
fix: add disconnected in roomstate
Browse files Browse the repository at this point in the history
  • Loading branch information
palashgo committed Apr 26, 2024
1 parent 1a98446 commit 04d74b0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 39 deletions.
18 changes: 0 additions & 18 deletions docs/react-web-core/local-user/events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,6 @@ meeting.self.on('mediaScoreUpdate', ({ kind, isScreenshare, score }) => {
});
```

## Webinar Stage events

In a `WEBINAR` setup, below events can be used to bring a user on to stage

| **Event** | **Description** |
| -------------------------- | ---------------------------------------------------------------------------------------- |
| `waitlisted` | Emitted when the user has been added to the waitlist. |
| `joinStageRequestAccepted` | Emitted to all host users, when a host accepts a user's request to join webinar meeting. |
| `joinStageRequestRejected` | Emitted to all host users, when a host rejects a user's request to join webinar meeting. |
| `removedFromStage` | Emitted when the user has been kicked from the webinar meeting. |
| `stageJoined` | Emitted when the user has joined the webinar meeting. |
| `stageLeft` | Emitted when the user has left the webinar meeting. |
| `peerRequestToJoinStage` | Emitted when a user has requested to join the webinar meeting. |
| `peerRejectedToJoinStage` | Emitted when the user's request to join the meeting has been rejected. |
| `peerAcceptedToJoinStage` | Emitted when the user's request to join the meeting has been accepted |
| `peerStoppedPresenting` | Emitted when a participant stops presenting in the webinar meeting. |
| `peerStartedPresenting` | Emitted when a participant starts presenting in the webinar meeting. |

## Permission Updates

Triggered when permissions are updated dynamically by a privileged user
Expand Down
36 changes: 34 additions & 2 deletions docs/react-web-core/local-user/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,46 @@ Here is a list of properties that local user provides:
"accepted" | "waiting" | "rejected" | "none"
```

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

```ts
"init" | "joined" | "waitlisted" | "rejected" | "kicked" | "left" | "ended"
"init" | "joined" | "waitlisted" | "rejected" | "kicked" | "left" | "ended" | "disconnected"
```
- `isPinned`: A boolean value indicating if the local user is pinned or not.

```mermaid
stateDiagram-v2
direction LR
classDef END fill:#ef4444,color:#fff,stroke:#ef4444;
[*] --> init
init --> joined
init --> waitlisted
waitlisted --> joined
waitlisted --> rejected
joined --> disconnected
disconnected --> joined
joined --> kicked
joined --> left
joined --> ended
class kicked,left,ended,rejected END
```

```ts
// subscribe to roomState
const roomState = useDyteSelector((m) => m.self.roomState)
return (
<>
{roomState === "disconnected" && <div>disconnected</div>}
</>
)
```




## Change the name of the local user
Expand Down
18 changes: 0 additions & 18 deletions docs/web-core/local-user/events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,24 +157,6 @@ meeting.self.on('mediaScoreUpdate', ({ kind, isScreenshare, score }) => {
});
```

## Webinar Stage events

In a `WEBINAR` setup, below events can be used to bring a user on to stage

| **Event** | **Description** |
| -------------------------- | ---------------------------------------------------------------------------------------- |
| `waitlisted` | Emitted when the user has been added to the waitlist. |
| `joinStageRequestAccepted` | Emitted to all host users, when a host accepts a user's request to join webinar meeting. |
| `joinStageRequestRejected` | Emitted to all host users, when a host rejects a user's request to join webinar meeting. |
| `removedFromStage` | Emitted when the user has been kicked from the webinar meeting. |
| `stageJoined` | Emitted when the user has joined the webinar meeting. |
| `stageLeft` | Emitted when the user has left the webinar meeting. |
| `peerRequestToJoinStage` | Emitted when a user has requested to join the webinar meeting. |
| `peerRejectedToJoinStage` | Emitted when the user's request to join the meeting has been rejected. |
| `peerAcceptedToJoinStage` | Emitted when the user's request to join the meeting has been accepted |
| `peerStoppedPresenting` | Emitted when a participant stops presenting in the webinar meeting. |
| `peerStartedPresenting` | Emitted when a participant starts presenting in the webinar meeting. |

<head>
<title>Web Core Events</title>
</head>
Expand Down
4 changes: 3 additions & 1 deletion docs/web-core/local-user/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Here is a list of properties that local user provides:
can take the following values:

```ts
"init" | "joined" | "waitlisted" | "rejected" | "kicked" | "left" | "ended"
"init" | "joined" | "waitlisted" | "rejected" | "kicked" | "left" | "ended" | "disconnected"
```

```mermaid
Expand All @@ -60,6 +60,8 @@ stateDiagram-v2
init --> waitlisted
waitlisted --> joined
waitlisted --> rejected
joined --> disconnected
disconnected --> joined
joined --> kicked
joined --> left
joined --> ended
Expand Down

0 comments on commit 04d74b0

Please sign in to comment.