-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #364 from dyte-io/docs/WEB-3793-network-indicator
docs(network-indicator): added dyte-network-indicator docs
- Loading branch information
Showing
3 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
description: >- | ||
Learn how to use and customize the dyte-network-indicator component in Dyte's React UI | ||
Kit with our detailed documentation. | ||
--- | ||
|
||
# dyte-network-indicator | ||
|
||
A component that indicates poor network connection. | ||
|
||
It listens to the mediaScoreUpdate event of the passed participant to get the score. | ||
|
||
```tsx | ||
(participant as DyteParticipant).addListener('mediaScoreUpdate', ({ kind, isScreenshare, score }) => { | ||
console.log(`Score for ${isScreenshare ? 'screen share': ''} ${kind} was:: ${score}`); | ||
}); | ||
``` | ||
|
||
:::note info | ||
|
||
This component will only be visible if the network quality is poor (less than or equal to 3, on a scale of 5, 5 being best). | ||
|
||
::: | ||
|
||
## Props | ||
|
||
<PropsTable of="dyte-network-indicator" /> | ||
|
||
<head> | ||
<title>React UI Kit dyte-network-indicator</title> | ||
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
description: >- | ||
Learn how to use and customize the DyteNetworkIndicator component in Dyte's React UI | ||
Kit with our detailed documentation. | ||
--- | ||
|
||
# DyteNetworkIndicator | ||
|
||
A component that indicates poor network connection. | ||
|
||
```jsx | ||
<DyteNetworkIndicator meeting={meeting} participant={meeting.self} /> | ||
``` | ||
|
||
It listens to the mediaScoreUpdate event of the passed participant to get the score. | ||
|
||
```tsx | ||
(participant as DyteParticipant).addListener('mediaScoreUpdate', ({ kind, isScreenshare, score }) => { | ||
console.log(`Score for ${isScreenshare ? 'screen share': ''} ${kind} was:: ${score}`); | ||
}); | ||
``` | ||
|
||
:::note info | ||
|
||
This component will only be visible if the network quality is poor (less than or equal to 3, on a scale of 5, 5 being best). | ||
|
||
::: | ||
|
||
## Props | ||
|
||
<PropsTable of="dyte-network-indicator" /> | ||
|
||
<head> | ||
<title>React UI Kit DyteNetworkIndicator</title> | ||
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
description: >- | ||
Learn how to use and customize the dyte-network-indicator component in Dyte's React UI | ||
Kit with our detailed documentation. | ||
--- | ||
|
||
# dyte-network-indicator | ||
|
||
A component that indicates poor network connection. | ||
|
||
```html | ||
<dyte-network-indicator class="dyte-el"></dyte-network-indicator> | ||
|
||
<script> | ||
const elements = document.getElementsByClassName('dyte-el'); | ||
for (const el of elements) { | ||
el.participant = meeting.self; | ||
el.meeting = meeting; | ||
} | ||
</script> | ||
``` | ||
|
||
It listens to the mediaScoreUpdate event of the passed participant to get the score. | ||
|
||
```tsx | ||
participant.addListener('mediaScoreUpdate', ({ kind, isScreenshare, score }) => { | ||
console.log(`Score for ${isScreenshare ? 'screen share': ''} ${kind} was:: ${score}`); | ||
}); | ||
``` | ||
|
||
:::note info | ||
|
||
This component will only be visible if the network quality is poor (less than or equal to 3, on a scale of 5, 5 being best). | ||
|
||
::: | ||
|
||
## Props | ||
|
||
<PropsTable of="dyte-network-indicator" /> | ||
|
||
<head> | ||
<title>React UI Kit dyte-network-indicator</title> | ||
</head> |