@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
# useEnsureTrackRef
|
|
4
|
+
|
|
5
|
+
Ensures that a track reference is provided, either via context or explicitly as a parameter. If not inside a `TrackRefContext` and no track reference is provided, an error is thrown.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { useEnsureTrackRef } from '@livekit/components-react';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
{% partial file="p_usage.md" variables={exampleCount: 0} /%}
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
{% parameter name="trackRef" type="TrackReferenceOrPlaceholder" optional=true %}
|
|
18
|
+
{% /parameter %}
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
TrackReferenceOrPlaceholder;
|
|
24
|
+
```
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# useEnsureTrackReference
|
|
4
4
|
|
|
5
|
+
> Warning: This API is now obsolete.
|
|
6
|
+
>
|
|
7
|
+
> `useEnsureTrackReference` has been to `useEnsureTrackRef`<!-- -->, use this as a drop in replacement.
|
|
8
|
+
|
|
5
9
|
Ensures that a track reference is provided, either via context or explicitly as a parameter. If not inside a `TrackContext` and no track reference is provided, an error is thrown.
|
|
6
10
|
|
|
7
11
|
## Import
|
|
@@ -19,4 +23,6 @@ import { useEnsureTrackReference } from '@livekit/components-react';
|
|
|
19
23
|
|
|
20
24
|
## Returns
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
```typescript
|
|
27
|
+
TrackReferenceOrPlaceholder;
|
|
28
|
+
```
|
|
@@ -2,19 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
# useFocusToggle
|
|
4
4
|
|
|
5
|
+
The `useFocusToggle` hook is used to implement the `FocusToggle` or your custom implementation of it. The `TrackReferenceOrPlaceholder` is used to register a onClick handler and to identify the track to focus on.
|
|
6
|
+
|
|
5
7
|
## Import
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { useFocusToggle } from '@livekit/components-react';
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
const { mergedProps, inFocus } = useFocusToggle({ trackRef, props: yourButtonProps });
|
|
17
|
+
return <button {...mergedProps}>{inFocus ? 'Unfocus' : 'Focus'}</button>;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
12
21
|
|
|
13
22
|
## Parameters
|
|
14
23
|
|
|
15
|
-
{% parameter name="{ trackSource, participant, props }" type="UseFocusToggleProps" optional=false %}
|
|
24
|
+
{% parameter name="{ trackRef, trackSource, participant, props }" type="UseFocusToggleProps" optional=false %}
|
|
16
25
|
{% /parameter %}
|
|
17
26
|
|
|
18
27
|
## Returns
|
|
19
28
|
|
|
20
|
-
|
|
29
|
+
```typescript
|
|
30
|
+
{
|
|
31
|
+
mergedProps: React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
32
|
+
className: string;
|
|
33
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
34
|
+
};
|
|
35
|
+
inFocus: boolean;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# useGridLayout
|
|
4
4
|
|
|
5
|
-
The useGridLayout hook tries to select the best layout to fit all tiles. If the available screen space is not enough, it will reduce the number of maximum visible tiles and select a layout that still works visually within the given limitations. As the order of tiles changes over time, the hook tries to keep visual updates to a minimum while trying to display important tiles such as speaking participants or screen shares.
|
|
5
|
+
The `useGridLayout` hook tries to select the best layout to fit all tiles. If the available screen space is not enough, it will reduce the number of maximum visible tiles and select a layout that still works visually within the given limitations. As the order of tiles changes over time, the hook tries to keep visual updates to a minimum while trying to display important tiles such as speaking participants or screen shares.
|
|
6
6
|
|
|
7
7
|
## Import
|
|
8
8
|
|
|
@@ -10,7 +10,13 @@ The useGridLayout hook tries to select the best layout to fit all tiles. If the
|
|
|
10
10
|
import { useGridLayout } from '@livekit/components-react';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
const { layout } = useGridLayout(gridElement, trackCount);
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
14
20
|
|
|
15
21
|
## Parameters
|
|
16
22
|
|
|
@@ -22,4 +28,8 @@ import { useGridLayout } from '@livekit/components-react';
|
|
|
22
28
|
|
|
23
29
|
## Returns
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
```typescript
|
|
32
|
+
{
|
|
33
|
+
layout: GridLayoutDefinition;
|
|
34
|
+
}
|
|
35
|
+
```
|
|
@@ -2,22 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
# useIsMuted
|
|
4
4
|
|
|
5
|
+
The `useIsMuted` hook is used to implement the `TrackMutedIndicator` or your custom implementation of it. It returns a `boolean` that indicates if the track is muted or not.
|
|
6
|
+
|
|
5
7
|
## Import
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { useIsMuted } from '@livekit/components-react';
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Usage
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
```tsx
|
|
16
|
+
const isMuted = useIsMuted(track);
|
|
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=false %}
|
|
19
24
|
{% /parameter %}
|
|
20
25
|
|
|
21
26
|
## Returns
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
```typescript
|
|
29
|
+
boolean;
|
|
30
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
# useIsMuted
|
|
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 { useIsMuted } 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="UseIsMutedOptions" optional=true %}
|
|
23
|
+
{% /parameter %}
|
|
24
|
+
|
|
25
|
+
## Returns
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
boolean;
|
|
29
|
+
```
|
|
@@ -2,13 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
# useIsSpeaking
|
|
4
4
|
|
|
5
|
+
The `useIsSpeaking` hook returns a `boolean` that indicates if the participant is speaking or not.
|
|
6
|
+
|
|
5
7
|
## Import
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { useIsSpeaking } from '@livekit/components-react';
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
const isSpeaking = useIsSpeaking(participant);
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
12
20
|
|
|
13
21
|
## Parameters
|
|
14
22
|
|
|
@@ -17,4 +25,6 @@ import { useIsSpeaking } from '@livekit/components-react';
|
|
|
17
25
|
|
|
18
26
|
## Returns
|
|
19
27
|
|
|
20
|
-
|
|
28
|
+
```typescript
|
|
29
|
+
boolean;
|
|
30
|
+
```
|
|
@@ -2,13 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
# useLiveKitRoom
|
|
4
4
|
|
|
5
|
+
The `useLiveKitRoom` hook is used to implement the `LiveKitRoom` or your custom implementation of it. It returns a `Room` instance and HTML props that should be applied to the root element of the component.
|
|
6
|
+
|
|
5
7
|
## Import
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { useLiveKitRoom } from '@livekit/components-react';
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
const { room, htmlProps } = useLiveKitRoom();
|
|
17
|
+
return <div {...htmlProps}>...</div>;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
12
21
|
|
|
13
22
|
## Parameters
|
|
14
23
|
|
|
@@ -17,4 +26,9 @@ import { useLiveKitRoom } from '@livekit/components-react';
|
|
|
17
26
|
|
|
18
27
|
## Returns
|
|
19
28
|
|
|
20
|
-
|
|
29
|
+
```typescript
|
|
30
|
+
{
|
|
31
|
+
room: Room | undefined;
|
|
32
|
+
htmlProps: HTMLAttributes<T>;
|
|
33
|
+
}
|
|
34
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# useLocalParticipant
|
|
4
4
|
|
|
5
|
-
The useLocalParticipant hook the state
|
|
5
|
+
The `useLocalParticipant` hook returns the local participant and the associated state around the participant.
|
|
6
6
|
|
|
7
7
|
## Import
|
|
8
8
|
|
|
@@ -10,7 +10,13 @@ The useLocalParticipant hook the state of the local participant.
|
|
|
10
10
|
import { useLocalParticipant } from '@livekit/components-react';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
const { localParticipant } = useLocalParticipant();
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
14
20
|
|
|
15
21
|
## Parameters
|
|
16
22
|
|
|
@@ -19,4 +25,15 @@ import { useLocalParticipant } from '@livekit/components-react';
|
|
|
19
25
|
|
|
20
26
|
## Returns
|
|
21
27
|
|
|
22
|
-
|
|
28
|
+
```typescript
|
|
29
|
+
{
|
|
30
|
+
isMicrophoneEnabled: boolean;
|
|
31
|
+
isScreenShareEnabled: boolean;
|
|
32
|
+
isCameraEnabled: boolean;
|
|
33
|
+
microphoneTrack: TrackPublication | undefined;
|
|
34
|
+
cameraTrack: TrackPublication | undefined;
|
|
35
|
+
lastMicrophoneError: Error | undefined;
|
|
36
|
+
lastCameraError: Error | undefined;
|
|
37
|
+
localParticipant: LocalParticipant;
|
|
38
|
+
}
|
|
39
|
+
```
|
|
@@ -2,14 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
# useLocalParticipantPermissions
|
|
4
4
|
|
|
5
|
+
The `useLocalParticipantPermissions` hook returns the local participant's permissions.
|
|
6
|
+
|
|
5
7
|
## Import
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { useLocalParticipantPermissions } from '@livekit/components-react';
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
const { canPublish, canPublishData } = useLocalParticipantPermissions();
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
12
20
|
|
|
13
21
|
## Returns
|
|
14
22
|
|
|
15
|
-
|
|
23
|
+
```typescript
|
|
24
|
+
import('livekit-client/dist/src/proto/livekit_models_pb').ParticipantPermission | undefined;
|
|
25
|
+
```
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# useMaybeTrackContext
|
|
4
4
|
|
|
5
|
+
> Warning: This API is now obsolete.
|
|
6
|
+
>
|
|
7
|
+
> `useMaybeTrackContext` has been to `useMaybeTrackRefContext`<!-- -->, use this as a drop in replacement.
|
|
8
|
+
|
|
5
9
|
Returns a track reference from the `TrackContext` if it exists, otherwise `undefined`<!-- -->.
|
|
6
10
|
|
|
7
11
|
## Import
|
|
@@ -14,4 +18,6 @@ import { useMaybeTrackContext } from '@livekit/components-react';
|
|
|
14
18
|
|
|
15
19
|
## Returns
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
```typescript
|
|
22
|
+
TrackReferenceOrPlaceholder | undefined;
|
|
23
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
# useMaybeTrackRefContext
|
|
4
|
+
|
|
5
|
+
Returns a track reference from the `TrackRefContext` if it exists, otherwise `undefined`<!-- -->.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { useMaybeTrackRefContext } from '@livekit/components-react';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
{% partial file="p_usage.md" variables={exampleCount: 0} /%}
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
TrackReferenceOrPlaceholder | undefined;
|
|
19
|
+
```
|
|
@@ -2,13 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
# useMediaDevices
|
|
4
4
|
|
|
5
|
+
The `useMediaDevices` hook returns the list of media devices of a given kind.
|
|
6
|
+
|
|
5
7
|
## Import
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { useMediaDevices } from '@livekit/components-react';
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
const videoDevices = useMediaDevices({ kind: 'videoinput' });
|
|
17
|
+
const audioDevices = useMediaDevices({ kind: 'audioinput' });
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
12
21
|
|
|
13
22
|
## Parameters
|
|
14
23
|
|
|
@@ -19,4 +28,6 @@ import { useMediaDevices } from '@livekit/components-react';
|
|
|
19
28
|
|
|
20
29
|
## Returns
|
|
21
30
|
|
|
22
|
-
|
|
31
|
+
```typescript
|
|
32
|
+
MediaDeviceInfo[]
|
|
33
|
+
```
|
|
@@ -2,13 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
# useMediaDeviceSelect
|
|
4
4
|
|
|
5
|
+
The `useMediaDeviceSelect` hook is used to implement the `MediaDeviceSelect` component and returns o.a. the list of devices of a given kind (audioinput or videoinput), the currently active device and a function to set the the active device.
|
|
6
|
+
|
|
5
7
|
## Import
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { useMediaDeviceSelect } from '@livekit/components-react';
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
const { devices, activeDeviceId, setActiveMediaDevice } = useMediaDeviceSelect({
|
|
17
|
+
kind: 'audioinput',
|
|
18
|
+
});
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
12
22
|
|
|
13
23
|
## Parameters
|
|
14
24
|
|
|
@@ -17,4 +27,11 @@ import { useMediaDeviceSelect } from '@livekit/components-react';
|
|
|
17
27
|
|
|
18
28
|
## Returns
|
|
19
29
|
|
|
20
|
-
|
|
30
|
+
```typescript
|
|
31
|
+
{
|
|
32
|
+
devices: MediaDeviceInfo[];
|
|
33
|
+
className: string;
|
|
34
|
+
activeDeviceId: string;
|
|
35
|
+
setActiveMediaDevice: (id: string, options?: import("@livekit/components-core").SetMediaDeviceOptions | undefined) => Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# useMediaTrack
|
|
4
4
|
|
|
5
|
+
> Warning: This API is now obsolete.
|
|
6
|
+
>
|
|
7
|
+
> use `useTrack` instead
|
|
8
|
+
|
|
5
9
|
## Import
|
|
6
10
|
|
|
7
11
|
```typescript
|
|
@@ -23,4 +27,12 @@ import { useMediaTrack } from '@livekit/components-react';
|
|
|
23
27
|
|
|
24
28
|
## Returns
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
```typescript
|
|
31
|
+
{
|
|
32
|
+
publication: import('livekit-client').TrackPublication | undefined;
|
|
33
|
+
isMuted: boolean | undefined;
|
|
34
|
+
isSubscribed: boolean | undefined;
|
|
35
|
+
track: import('livekit-client').Track | undefined;
|
|
36
|
+
elementProps: React.HTMLAttributes<HTMLElement>;
|
|
37
|
+
}
|
|
38
|
+
```
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# useMediaTrackByName
|
|
4
4
|
|
|
5
|
+
> Warning: This API is now obsolete.
|
|
6
|
+
>
|
|
7
|
+
> This function will be removed in a future version, use `useTrackByName` instead.
|
|
8
|
+
|
|
5
9
|
## Import
|
|
6
10
|
|
|
7
11
|
```typescript
|
|
@@ -23,4 +27,12 @@ import { useMediaTrackByName } from '@livekit/components-react';
|
|
|
23
27
|
|
|
24
28
|
## Returns
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
```typescript
|
|
31
|
+
{
|
|
32
|
+
publication: import('livekit-client').TrackPublication | undefined;
|
|
33
|
+
isMuted: boolean | undefined;
|
|
34
|
+
isSubscribed: boolean | undefined;
|
|
35
|
+
track: import('livekit-client').Track | undefined;
|
|
36
|
+
elementProps: import('react').HTMLAttributes<HTMLElement>;
|
|
37
|
+
}
|
|
38
|
+
```
|
|
@@ -17,4 +17,10 @@ import { useParticipantInfo } from '@livekit/components-react';
|
|
|
17
17
|
|
|
18
18
|
## Returns
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
```typescript
|
|
21
|
+
{
|
|
22
|
+
identity: string;
|
|
23
|
+
name: string | undefined;
|
|
24
|
+
metadata: string | undefined;
|
|
25
|
+
}
|
|
26
|
+
```
|
|
@@ -17,4 +17,6 @@ import { useParticipantPermissions } from '@livekit/components-react';
|
|
|
17
17
|
|
|
18
18
|
## Returns
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
```typescript
|
|
21
|
+
import('livekit-client/dist/src/proto/livekit_models_pb').ParticipantPermission | undefined;
|
|
22
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# useParticipants
|
|
4
4
|
|
|
5
|
-
The useParticipants hook returns all participants (local and remote) of the current room.
|
|
5
|
+
The `useParticipants` hook returns all participants (local and remote) of the current room.
|
|
6
6
|
|
|
7
7
|
## Import
|
|
8
8
|
|
|
@@ -10,7 +10,20 @@ The useParticipants hook returns all participants (local and remote) of the curr
|
|
|
10
10
|
import { useParticipants } 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 = useParticipants();
|
|
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 { useParticipants } from '@livekit/components-react';
|
|
|
19
32
|
|
|
20
33
|
## Returns
|
|
21
34
|
|
|
22
|
-
|
|
35
|
+
```typescript
|
|
36
|
+
(import("livekit-client").RemoteParticipant | import("livekit-client").LocalParticipant)[]
|
|
37
|
+
```
|
|
@@ -2,19 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
# useParticipantTile
|
|
4
4
|
|
|
5
|
+
The `useParticipantTile` hook is used to implement the `ParticipantTile` and returns the props needed to render the tile.
|
|
6
|
+
|
|
5
7
|
## Import
|
|
6
8
|
|
|
7
9
|
```typescript
|
|
8
10
|
import { useParticipantTile } from '@livekit/components-react';
|
|
9
11
|
```
|
|
10
12
|
|
|
13
|
+
## Remarks
|
|
14
|
+
|
|
15
|
+
The returned props include many data attributes that are useful for CSS styling purposes because they indicate the state of the participant and the track. For example: `data-lk-audio-muted`<!-- -->, `data-lk-video-muted`<!-- -->, `data-lk-speaking`<!-- -->, `data-lk-local-participant`<!-- -->, `data-lk-source`<!-- -->, `data-lk-facing-mode`<!-- -->.
|
|
16
|
+
|
|
11
17
|
{% partial file="p_usage.md" variables={exampleCount: 0} /%}
|
|
12
18
|
|
|
13
19
|
## Parameters
|
|
14
20
|
|
|
15
|
-
{% parameter name="{ participant, source, publication, onParticipantClick, disableSpeakingIndicator, htmlProps, }" type="UseParticipantTileProps<T>" optional=false %}
|
|
21
|
+
{% parameter name="{ trackRef, participant, source, publication, onParticipantClick, disableSpeakingIndicator, htmlProps, }" type="UseParticipantTileProps<T>" optional=false %}
|
|
16
22
|
{% /parameter %}
|
|
17
23
|
|
|
18
24
|
## Returns
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
```typescript
|
|
27
|
+
{
|
|
28
|
+
elementProps: React.HTMLAttributes<T>;
|
|
29
|
+
}
|
|
30
|
+
```
|