@livekit/components-js-docs 0.0.4 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generated-docs/core/encryptionstatusobservable.md +12 -0
- package/generated-docs/core/gettrackreferenceid.md +5 -1
- package/generated-docs/core/index.md +114 -109
- package/generated-docs/core/isparticipantsourcepinned.md +4 -0
- package/generated-docs/core/isparticipanttrackreferencepinned.md +16 -0
- package/generated-docs/core/mutedobserver.md +1 -4
- package/generated-docs/core/setupconnectionqualityindicator.md +1 -59
- package/generated-docs/core/setuptrackmutedindicator.md +1 -4
- package/generated-docs/core/trackreferenceid.md +9 -0
- package/generated-docs/react/audiotrackprops.md +9 -8
- package/generated-docs/react/audiotrackprops.name.md +6 -0
- package/generated-docs/react/audiotrackprops.participant.md +6 -0
- package/generated-docs/react/audiotrackprops.publication.md +6 -0
- package/generated-docs/react/audiotrackprops.source.md +7 -1
- package/generated-docs/react/audiotrackprops.trackref.md +13 -0
- package/generated-docs/react/audiovisualizerprops.md +4 -3
- package/generated-docs/react/audiovisualizerprops.participant.md +6 -0
- package/generated-docs/react/audiovisualizerprops.trackref.md +9 -0
- package/generated-docs/react/{carouselviewprops.children.md → carousellayoutprops.children.md} +1 -1
- package/generated-docs/react/carousellayoutprops.md +21 -0
- package/generated-docs/react/{carouselviewprops.orientation.md → carousellayoutprops.orientation.md} +1 -1
- package/generated-docs/react/{carouselviewprops.tracks.md → carousellayoutprops.tracks.md} +1 -1
- package/generated-docs/react/carouselview.md +15 -0
- package/generated-docs/react/chatprops.md +2 -2
- package/generated-docs/react/component/audiotrack.md +11 -4
- package/generated-docs/react/component/audiovisualizer.md +18 -1
- package/generated-docs/react/component/{carouselview.md → carousellayout.md} +8 -4
- package/generated-docs/react/component/chattoggle.md +5 -1
- package/generated-docs/react/component/clearpinbutton.md +3 -3
- package/generated-docs/react/component/connectionqualityindicator.md +1 -1
- package/generated-docs/react/component/connectionstate.md +1 -1
- package/generated-docs/react/component/connectionstatetoast.md +2 -0
- package/generated-docs/react/component/controlbar.md +1 -1
- package/generated-docs/react/component/disconnectbutton.md +1 -1
- package/generated-docs/react/component/focuslayout.md +7 -0
- package/generated-docs/react/component/focuslayoutcontainer.md +2 -0
- package/generated-docs/react/component/focustoggle.md +14 -3
- package/generated-docs/react/component/gridlayout.md +5 -1
- package/generated-docs/react/component/livekitroom.md +1 -1
- package/generated-docs/react/component/mediadevicemenu.md +1 -1
- package/generated-docs/react/component/mediadeviceselect.md +1 -1
- package/generated-docs/react/component/participantaudiotile.md +6 -1
- package/generated-docs/react/component/participantcontextifneeded.md +11 -1
- package/generated-docs/react/component/participantloop.md +1 -1
- package/generated-docs/react/component/participantname.md +1 -1
- package/generated-docs/react/component/participanttile.md +20 -5
- package/generated-docs/react/component/prejoin.md +7 -2
- package/generated-docs/react/component/roomaudiorenderer.md +1 -1
- package/generated-docs/react/component/roomname.md +1 -1
- package/generated-docs/react/component/startaudio.md +1 -1
- package/generated-docs/react/component/toast.md +9 -1
- package/generated-docs/react/component/trackloop.md +6 -6
- package/generated-docs/react/component/trackmutedindicator.md +11 -4
- package/generated-docs/react/component/tracktoggle.md +1 -1
- package/generated-docs/react/component/videoconference.md +2 -2
- package/generated-docs/react/component/videotrack.md +12 -5
- package/generated-docs/react/focuslayoutcontainerprops.focustrack.md +6 -0
- package/generated-docs/react/focuslayoutcontainerprops.participants.md +6 -0
- package/generated-docs/react/focuslayoutprops.md +5 -4
- package/generated-docs/react/focuslayoutprops.track.md +6 -0
- package/generated-docs/react/focuslayoutprops.trackref.md +13 -0
- package/generated-docs/react/focustoggleprops.md +5 -4
- package/generated-docs/react/focustoggleprops.participant.md +6 -0
- package/generated-docs/react/focustoggleprops.trackref.md +9 -0
- package/generated-docs/react/focustoggleprops.tracksource.md +7 -1
- package/generated-docs/react/hook/usechat.md +13 -1
- package/generated-docs/react/hook/usechattoggle.md +16 -1
- package/generated-docs/react/hook/useclearpinbutton.md +11 -1
- package/generated-docs/react/hook/useconnectionqualityindicator.md +17 -2
- package/generated-docs/react/hook/useconnectionstate.md +3 -1
- package/generated-docs/react/hook/usecreatelayoutcontext.md +3 -1
- package/generated-docs/react/hook/usedatachannel.md +17 -2
- package/generated-docs/react/hook/usedatachannel_1.md +17 -2
- package/generated-docs/react/hook/usedisconnectbutton.md +19 -2
- package/generated-docs/react/hook/useensurecreatelayoutcontext.md +3 -1
- package/generated-docs/react/hook/useensurelayoutcontext.md +3 -1
- package/generated-docs/react/hook/useensureparticipant.md +3 -1
- package/generated-docs/react/hook/useensureroom.md +3 -1
- package/generated-docs/react/hook/useensuretrackref.md +24 -0
- package/generated-docs/react/hook/useensuretrackreference.md +7 -1
- package/generated-docs/react/hook/usefocustoggle.md +20 -3
- package/generated-docs/react/hook/usegridlayout.md +13 -3
- package/generated-docs/react/hook/useismuted.md +13 -6
- package/generated-docs/react/hook/useismuted_1.md +29 -0
- package/generated-docs/react/hook/useisspeaking.md +12 -2
- package/generated-docs/react/hook/uselayoutcontext.md +3 -1
- package/generated-docs/react/hook/uselivekitroom.md +16 -2
- package/generated-docs/react/hook/uselocalparticipant.md +20 -3
- package/generated-docs/react/hook/uselocalparticipantpermissions.md +12 -2
- package/generated-docs/react/hook/usemaybelayoutcontext.md +3 -1
- package/generated-docs/react/hook/usemaybeparticipantcontext.md +3 -1
- package/generated-docs/react/hook/usemayberoomcontext.md +3 -1
- package/generated-docs/react/hook/usemaybetrackcontext.md +7 -1
- package/generated-docs/react/hook/usemaybetrackrefcontext.md +19 -0
- package/generated-docs/react/hook/usemediadevices.md +13 -2
- package/generated-docs/react/hook/usemediadeviceselect.md +19 -2
- package/generated-docs/react/hook/usemediatrack.md +13 -1
- package/generated-docs/react/hook/usemediatrackbyname.md +13 -1
- package/generated-docs/react/hook/useparticipantcontext.md +3 -1
- package/generated-docs/react/hook/useparticipantinfo.md +7 -1
- package/generated-docs/react/hook/useparticipantpermissions.md +3 -1
- package/generated-docs/react/hook/useparticipants.md +18 -3
- package/generated-docs/react/hook/useparticipanttile.md +12 -2
- package/generated-docs/react/hook/usepinnedtracks.md +16 -2
- package/generated-docs/react/hook/usepreviewdevice.md +7 -1
- package/generated-docs/react/hook/useremoteparticipant.md +16 -2
- package/generated-docs/react/hook/useremoteparticipants.md +18 -3
- package/generated-docs/react/hook/useroomcontext.md +3 -1
- package/generated-docs/react/hook/useroominfo.md +6 -1
- package/generated-docs/react/hook/usesortedparticipants.md +4 -2
- package/generated-docs/react/hook/usespeakingparticipants.md +11 -3
- package/generated-docs/react/hook/usetoken.md +12 -2
- package/generated-docs/react/hook/usetrack.md +31 -0
- package/generated-docs/react/hook/usetrackbyname.md +31 -0
- package/generated-docs/react/hook/usetrackcontext.md +8 -2
- package/generated-docs/react/hook/usetrackmutedindicator.md +13 -6
- package/generated-docs/react/hook/usetrackmutedindicator_1.md +29 -0
- package/generated-docs/react/hook/usetrackrefcontext.md +19 -0
- package/generated-docs/react/hook/usetracks.md +3 -1
- package/generated-docs/react/hook/usetracktoggle.md +19 -2
- package/generated-docs/react/hook/usevisualstableupdate.md +16 -7
- package/generated-docs/react/index.md +163 -155
- package/generated-docs/react/localuserchoices.md +2 -0
- package/generated-docs/react/meta-data.json +1 -1
- package/generated-docs/react/participanttileprops.md +8 -7
- package/generated-docs/react/participanttileprops.participant.md +6 -0
- package/generated-docs/react/participanttileprops.publication.md +6 -0
- package/generated-docs/react/participanttileprops.source.md +6 -0
- package/generated-docs/react/participanttileprops.trackref.md +13 -0
- package/generated-docs/react/prejoinprops.md +12 -11
- package/generated-docs/react/prejoinprops.showe2eeoptions.md +9 -0
- package/generated-docs/react/trackcontext.md +4 -0
- package/generated-docs/react/trackmutedindicatorprops.md +6 -5
- package/generated-docs/react/trackmutedindicatorprops.participant.md +6 -0
- package/generated-docs/react/trackmutedindicatorprops.source.md +7 -1
- package/generated-docs/react/trackmutedindicatorprops.trackref.md +9 -0
- package/generated-docs/react/trackrefcontext.md +13 -0
- package/generated-docs/react/usefocustoggleprops.md +6 -5
- package/generated-docs/react/usefocustoggleprops.participant.md +6 -0
- package/generated-docs/react/usefocustoggleprops.trackref.md +9 -0
- package/generated-docs/react/usefocustoggleprops.tracksource.md +7 -1
- package/generated-docs/react/useparticipantinfooptions.md +9 -1
- package/generated-docs/react/useparticipantpermissionsoptions.md +9 -1
- package/generated-docs/react/useparticipanttileprops.md +9 -8
- package/generated-docs/react/useparticipanttileprops.participant.md +7 -1
- package/generated-docs/react/useparticipanttileprops.publication.md +6 -0
- package/generated-docs/react/useparticipanttileprops.source.md +7 -1
- package/generated-docs/react/useparticipanttileprops.trackref.md +13 -0
- package/generated-docs/react/useremoteparticipantoptions.md +3 -3
- package/generated-docs/react/useremoteparticipantoptions.updateonlyon.md +4 -0
- package/generated-docs/react/useroominfooptions.md +13 -1
- package/generated-docs/react/usetrackmutedindicatoroptions.participant.md +6 -0
- package/generated-docs/react/usetrackoptions.element.md +9 -0
- package/generated-docs/react/usetrackoptions.md +18 -0
- package/generated-docs/react/usetrackoptions.props.md +9 -0
- package/generated-docs/react/videoconferenceprops.md +2 -2
- package/generated-docs/react/videotrackprops.md +10 -9
- package/generated-docs/react/videotrackprops.name.md +6 -0
- package/generated-docs/react/videotrackprops.participant.md +6 -0
- package/generated-docs/react/videotrackprops.publication.md +6 -0
- package/generated-docs/react/videotrackprops.source.md +7 -1
- package/generated-docs/react/videotrackprops.trackref.md +13 -0
- package/package.json +1 -1
- package/generated-docs/react/carouselviewprops.md +0 -21
- /package/generated-docs/{react → core}/messagedecoder.md +0 -0
- /package/generated-docs/{react → core}/messageencoder.md +0 -0
|
@@ -2,13 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
# usePinnedTracks
|
|
4
4
|
|
|
5
|
+
The `usePinnedTracks` hook returns a array of the pinned tracks of the current room.
|
|
6
|
+
|
|
5
7
|
## Import
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { usePinnedTracks } from '@livekit/components-react';
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Remarks
|
|
14
|
+
|
|
15
|
+
To function properly, this hook must be called within a `LayoutContext`<!-- -->.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
const pinnedTracks = usePinnedTracks();
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
12
24
|
|
|
13
25
|
## Parameters
|
|
14
26
|
|
|
@@ -17,4 +29,6 @@ import { usePinnedTracks } from '@livekit/components-react';
|
|
|
17
29
|
|
|
18
30
|
## Returns
|
|
19
31
|
|
|
20
|
-
|
|
32
|
+
```typescript
|
|
33
|
+
TrackReferenceOrPlaceholder[]
|
|
34
|
+
```
|
|
@@ -23,4 +23,10 @@ import { usePreviewDevice } from '@livekit/components-react';
|
|
|
23
23
|
|
|
24
24
|
## Returns
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
```typescript
|
|
27
|
+
{
|
|
28
|
+
selectedDevice: MediaDeviceInfo | undefined;
|
|
29
|
+
localTrack: T | undefined;
|
|
30
|
+
deviceError: Error | null;
|
|
31
|
+
}
|
|
32
|
+
```
|
|
@@ -2,13 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
# useRemoteParticipant
|
|
4
4
|
|
|
5
|
+
The `useRemoteParticipant` hook returns the RemoteParticipant with the given `identity`<!-- -->.
|
|
6
|
+
|
|
5
7
|
## Import
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { useRemoteParticipant } from '@livekit/components-react';
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Remarks
|
|
14
|
+
|
|
15
|
+
To optimize performance, you can use the `updateOnlyOn` property to decide on what `ParticipantEvents` the hook updates.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
const participant = useRemoteParticipant('Russ');
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
12
24
|
|
|
13
25
|
## Parameters
|
|
14
26
|
|
|
@@ -20,4 +32,6 @@ import { useRemoteParticipant } from '@livekit/components-react';
|
|
|
20
32
|
|
|
21
33
|
## Returns
|
|
22
34
|
|
|
23
|
-
|
|
35
|
+
```typescript
|
|
36
|
+
RemoteParticipant | undefined;
|
|
37
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# useRemoteParticipants
|
|
4
4
|
|
|
5
|
-
The useRemoteParticipants
|
|
5
|
+
The `useRemoteParticipants` hook returns all remote participants (without the local) of the current room.
|
|
6
6
|
|
|
7
7
|
## Import
|
|
8
8
|
|
|
@@ -10,7 +10,20 @@ The useRemoteParticipants
|
|
|
10
10
|
import { useRemoteParticipants } from '@livekit/components-react';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Remarks
|
|
14
|
+
|
|
15
|
+
To optimize performance, you can use the `updateOnlyOn` property to decide on what `RoomEvents` the hook updates.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
const participants = useRemoteParticipants();
|
|
21
|
+
<ParticipantLoop participants={participants}>
|
|
22
|
+
<ParticipantName />
|
|
23
|
+
</ParticipantLoop>;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
14
27
|
|
|
15
28
|
## Parameters
|
|
16
29
|
|
|
@@ -19,4 +32,6 @@ import { useRemoteParticipants } from '@livekit/components-react';
|
|
|
19
32
|
|
|
20
33
|
## Returns
|
|
21
34
|
|
|
22
|
-
|
|
35
|
+
```typescript
|
|
36
|
+
RemoteParticipant[]
|
|
37
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# useSortedParticipants
|
|
4
4
|
|
|
5
|
-
The useSortedParticipants hook returns the
|
|
5
|
+
The `useSortedParticipants` hook returns the participants sorted by importance.
|
|
6
6
|
|
|
7
7
|
## Import
|
|
8
8
|
|
|
@@ -19,4 +19,6 @@ import { useSortedParticipants } from '@livekit/components-react';
|
|
|
19
19
|
|
|
20
20
|
## Returns
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
```typescript
|
|
23
|
+
Participant[]
|
|
24
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# useSpeakingParticipants
|
|
4
4
|
|
|
5
|
-
The useSpeakingParticipants hook returns the only the active speakers of all participants.
|
|
5
|
+
The `useSpeakingParticipants` hook returns the only the active speakers of all participants.
|
|
6
6
|
|
|
7
7
|
## Import
|
|
8
8
|
|
|
@@ -10,8 +10,16 @@ The useSpeakingParticipants hook returns the only the active speakers of all par
|
|
|
10
10
|
import { useSpeakingParticipants } from '@livekit/components-react';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
const activeSpeakers = useSpeakingParticipants();
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
14
20
|
|
|
15
21
|
## Returns
|
|
16
22
|
|
|
17
|
-
|
|
23
|
+
```typescript
|
|
24
|
+
import("livekit-client").Participant[]
|
|
25
|
+
```
|
|
@@ -2,13 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
# useToken
|
|
4
4
|
|
|
5
|
+
The `useToken` hook fetches a token from the given token endpoint with the given user info.
|
|
6
|
+
|
|
5
7
|
## Import
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { useToken } from '@livekit/components-react';
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
const token = useToken(<token-endpoint>, roomName, { userInfo: { identity, name }});
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
12
20
|
|
|
13
21
|
## Parameters
|
|
14
22
|
|
|
@@ -23,4 +31,6 @@ import { useToken } from '@livekit/components-react';
|
|
|
23
31
|
|
|
24
32
|
## Returns
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
```typescript
|
|
35
|
+
string | undefined;
|
|
36
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
# useTrack
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { useTrack } from '@livekit/components-react';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
{% partial file="p_usage.md" variables={exampleCount: 0} /%}
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
{% parameter name="trackRef" type="TrackIdentifier" optional=false %}
|
|
16
|
+
{% /parameter %}
|
|
17
|
+
|
|
18
|
+
{% parameter name="options" type="UseTrackOptions" optional=true %}
|
|
19
|
+
{% /parameter %}
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
{
|
|
25
|
+
publication: import('livekit-client').TrackPublication | undefined;
|
|
26
|
+
isMuted: boolean | undefined;
|
|
27
|
+
isSubscribed: boolean | undefined;
|
|
28
|
+
track: import('livekit-client').Track | undefined;
|
|
29
|
+
elementProps: React.HTMLAttributes<HTMLElement>;
|
|
30
|
+
}
|
|
31
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
# useTrackByName
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { useTrackByName } from '@livekit/components-react';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
{% partial file="p_usage.md" variables={exampleCount: 0} /%}
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
{% parameter name="options" type="UseMediaTrackOptions" optional=true %}
|
|
16
|
+
{% /parameter %}
|
|
17
|
+
|
|
18
|
+
{% parameter name="trackRef" type="TrackReferenceOrPlaceholder" optional=true %}
|
|
19
|
+
{% /parameter %}
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
{
|
|
25
|
+
publication: import('livekit-client').TrackPublication | undefined;
|
|
26
|
+
isMuted: boolean | undefined;
|
|
27
|
+
isSubscribed: boolean | undefined;
|
|
28
|
+
track: import('livekit-client').Track | undefined;
|
|
29
|
+
elementProps: import('react').HTMLAttributes<HTMLElement>;
|
|
30
|
+
}
|
|
31
|
+
```
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# useTrackContext
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> Warning: This API is now obsolete.
|
|
6
|
+
>
|
|
7
|
+
> `useTrackContext` has been to `useTrackRefContext`<!-- -->, use this as a drop in replacement.
|
|
8
|
+
|
|
9
|
+
Ensures that a track reference is provided via context. If not inside a `TrackRefContext`<!-- -->, an error is thrown.
|
|
6
10
|
|
|
7
11
|
## Import
|
|
8
12
|
|
|
@@ -14,4 +18,6 @@ import { useTrackContext } from '@livekit/components-react';
|
|
|
14
18
|
|
|
15
19
|
## Returns
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
```typescript
|
|
22
|
+
TrackReferenceOrPlaceholder;
|
|
23
|
+
```
|
|
@@ -2,22 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
# useTrackMutedIndicator
|
|
4
4
|
|
|
5
|
+
The `useTrackMutedIndicator` hook is used to implement the `TrackMutedIndicator` component and returns the muted state of the given track.
|
|
6
|
+
|
|
5
7
|
## Import
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { useTrackMutedIndicator } from '@livekit/components-react';
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Usage
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
```tsx
|
|
16
|
+
const { isMuted } = useTrackMutedIndicator(trackRef);
|
|
17
|
+
```
|
|
14
18
|
|
|
15
|
-
{%
|
|
16
|
-
{% /parameter %}
|
|
19
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
## Parameters
|
|
22
|
+
|
|
23
|
+
{% parameter name="trackRef" type="TrackReferenceOrPlaceholder" optional=true %}
|
|
19
24
|
{% /parameter %}
|
|
20
25
|
|
|
21
26
|
## Returns
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
```typescript
|
|
29
|
+
TrackMutedIndicatorReturnType;
|
|
30
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
# useTrackMutedIndicator
|
|
4
|
+
|
|
5
|
+
> Warning: This API is now obsolete.
|
|
6
|
+
>
|
|
7
|
+
> This overload will be removed in a future version, pass in trackRef instead.
|
|
8
|
+
|
|
9
|
+
## Import
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { useTrackMutedIndicator } from '@livekit/components-react';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
{% partial file="p_usage.md" variables={exampleCount: 0} /%}
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
{% parameter name="source" type="Track.Source" optional=false %}
|
|
20
|
+
{% /parameter %}
|
|
21
|
+
|
|
22
|
+
{% parameter name="options" type="UseTrackMutedIndicatorOptions" optional=true %}
|
|
23
|
+
{% /parameter %}
|
|
24
|
+
|
|
25
|
+
## Returns
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
TrackMutedIndicatorReturnType;
|
|
29
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
# useTrackRefContext
|
|
4
|
+
|
|
5
|
+
Ensures that a track reference is provided via context. If not inside a `TrackRefContext`<!-- -->, an error is thrown.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { useTrackRefContext } from '@livekit/components-react';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
{% partial file="p_usage.md" variables={exampleCount: 0} /%}
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
TrackReferenceOrPlaceholder;
|
|
19
|
+
```
|
|
@@ -2,13 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
# useTrackToggle
|
|
4
4
|
|
|
5
|
+
The `useTrackToggle` hook is used to implement the `TrackToggle` component and returns state and functionality of the given track.
|
|
6
|
+
|
|
5
7
|
## Import
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { useTrackToggle } from '@livekit/components-react';
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
const { buttonProps, enabled } = useTrackToggle(trackRef);
|
|
17
|
+
return <button {...buttonProps}>{enabled ? 'disable' : 'enable'}</button>;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
12
21
|
|
|
13
22
|
## Parameters
|
|
14
23
|
|
|
@@ -17,4 +26,12 @@ import { useTrackToggle } from '@livekit/components-react';
|
|
|
17
26
|
|
|
18
27
|
## Returns
|
|
19
28
|
|
|
20
|
-
|
|
29
|
+
```typescript
|
|
30
|
+
{
|
|
31
|
+
toggle: ((forceState?: boolean | undefined) => void) | ((forceState?: boolean | undefined, captureOptions?: import("@livekit/components-core").CaptureOptionsBySource<T> | undefined) => Promise<void>);
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
pending: boolean;
|
|
34
|
+
track: import("livekit-client").LocalTrackPublication | undefined;
|
|
35
|
+
buttonProps: React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# useVisualStableUpdate
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
The useVisualStableUpdate hook tries to keep visual updates of the TackBundles array to a minimum, while still trying to display important tiles such as speaking participants or screen shares.
|
|
8
|
-
|
|
9
|
-
Updating works with pagination. For example, if a participant starts speaking on the second page, they will be moved to the first page by replacing the least active/interesting participant on the first page.
|
|
5
|
+
The `useVisualStableUpdate` hook is used to prevent visually jarring jumps and shifts of elements in an array. The algorithm only starts to update when there are more items than visually fit on a page. If this is the case, it will make sure that speaking participants move to the first page and are always visible. Updating the array can occur because attendees leave or join a room, or because they mute/unmute or start speaking.
|
|
10
6
|
|
|
11
7
|
## Import
|
|
12
8
|
|
|
@@ -14,7 +10,18 @@ Updating works with pagination. For example, if a participant starts speaking on
|
|
|
14
10
|
import { useVisualStableUpdate } from '@livekit/components-react';
|
|
15
11
|
```
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
## Remarks
|
|
14
|
+
|
|
15
|
+
The hook is used for the `GridLayout` and `CarouselLayout` components.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
const trackRefs = useTracks();
|
|
21
|
+
const updatedTrackRefs = useVisualStableUpdate(trackRefs, itemPerPage);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
18
25
|
|
|
19
26
|
## Parameters
|
|
20
27
|
|
|
@@ -29,4 +36,6 @@ import { useVisualStableUpdate } from '@livekit/components-react';
|
|
|
29
36
|
|
|
30
37
|
## Returns
|
|
31
38
|
|
|
32
|
-
|
|
39
|
+
```typescript
|
|
40
|
+
TrackReferenceOrPlaceholder[]
|
|
41
|
+
```
|