Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(network-indicator): added dyte-network-indicator docs #364

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/angular-ui-kit/components/dyte-network-indicator.mdx
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>
35 changes: 35 additions & 0 deletions docs/react-ui-kit/components/dyte-network-indicator.mdx
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>
43 changes: 43 additions & 0 deletions docs/ui-kit/components/dyte-network-indicator.mdx
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>