Skip to content

Commit f80459c

Browse files
committed
docs(network-indicator): added dyte-network-indicator docs
1 parent cf27048 commit f80459c

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
description: >-
3+
Learn how to use and customize the dyte-network-indicator component in Dyte's React UI
4+
Kit with our detailed documentation.
5+
---
6+
7+
# dyte-network-indicator
8+
9+
A component that indicates poor network connection.
10+
11+
It listens to the mediaScoreUpdate event of the passed participant to get the score.
12+
13+
```tsx
14+
(participant as DyteParticipant).addListener('mediaScoreUpdate', ({ kind, isScreenshare, score }) => {
15+
console.log(`Score for ${isScreenshare ? 'screen share': ''} ${kind} was:: ${score}`);
16+
});
17+
```
18+
19+
:::note info
20+
21+
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).
22+
23+
:::
24+
25+
## Props
26+
27+
<PropsTable of="dyte-network-indicator" />
28+
29+
<head>
30+
<title>React UI Kit dyte-network-indicator</title>
31+
</head>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
description: >-
3+
Learn how to use and customize the DyteNetworkIndicator component in Dyte's React UI
4+
Kit with our detailed documentation.
5+
---
6+
7+
# DyteNetworkIndicator
8+
9+
A component that indicates poor network connection.
10+
11+
```jsx
12+
<DyteNetworkIndicator meeting={meeting} participant={meeting.self} />
13+
```
14+
15+
It listens to the mediaScoreUpdate event of the passed participant to get the score.
16+
17+
```tsx
18+
(participant as DyteParticipant).addListener('mediaScoreUpdate', ({ kind, isScreenshare, score }) => {
19+
console.log(`Score for ${isScreenshare ? 'screen share': ''} ${kind} was:: ${score}`);
20+
});
21+
```
22+
23+
:::note info
24+
25+
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).
26+
27+
:::
28+
29+
## Props
30+
31+
<PropsTable of="dyte-network-indicator" />
32+
33+
<head>
34+
<title>React UI Kit DyteNetworkIndicator</title>
35+
</head>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
description: >-
3+
Learn how to use and customize the dyte-network-indicator component in Dyte's React UI
4+
Kit with our detailed documentation.
5+
---
6+
7+
# dyte-network-indicator
8+
9+
A component that indicates poor network connection.
10+
11+
```html
12+
<dyte-network-indicator class="dyte-el"></dyte-network-indicator>
13+
14+
<script>
15+
const elements = document.getElementsByClassName('dyte-el');
16+
for (const el of elements) {
17+
el.participant = meeting.self;
18+
el.meeting = meeting;
19+
}
20+
</script>
21+
```
22+
23+
It listens to the mediaScoreUpdate event of the passed participant to get the score.
24+
25+
```tsx
26+
participant.addListener('mediaScoreUpdate', ({ kind, isScreenshare, score }) => {
27+
console.log(`Score for ${isScreenshare ? 'screen share': ''} ${kind} was:: ${score}`);
28+
});
29+
```
30+
31+
:::note info
32+
33+
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).
34+
35+
:::
36+
37+
## Props
38+
39+
<PropsTable of="dyte-network-indicator" />
40+
41+
<head>
42+
<title>React UI Kit dyte-network-indicator</title>
43+
</head>

0 commit comments

Comments
 (0)