@livekit/components-js-docs 0.0.5 → 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.
Files changed (148) hide show
  1. package/generated-docs/core/gettrackreferenceid.md +5 -1
  2. package/generated-docs/core/index.md +114 -110
  3. package/generated-docs/core/isparticipantsourcepinned.md +4 -0
  4. package/generated-docs/core/isparticipanttrackreferencepinned.md +16 -0
  5. package/generated-docs/core/mutedobserver.md +1 -4
  6. package/generated-docs/core/setupconnectionqualityindicator.md +1 -59
  7. package/generated-docs/core/setuptrackmutedindicator.md +1 -4
  8. package/generated-docs/core/trackreferenceid.md +9 -0
  9. package/generated-docs/react/audiotrackprops.md +9 -8
  10. package/generated-docs/react/audiotrackprops.name.md +6 -0
  11. package/generated-docs/react/audiotrackprops.participant.md +6 -0
  12. package/generated-docs/react/audiotrackprops.publication.md +6 -0
  13. package/generated-docs/react/audiotrackprops.source.md +7 -1
  14. package/generated-docs/react/audiotrackprops.trackref.md +13 -0
  15. package/generated-docs/react/audiovisualizerprops.md +4 -3
  16. package/generated-docs/react/audiovisualizerprops.participant.md +6 -0
  17. package/generated-docs/react/audiovisualizerprops.trackref.md +9 -0
  18. package/generated-docs/react/{carouselviewprops.children.md → carousellayoutprops.children.md} +1 -1
  19. package/generated-docs/react/carousellayoutprops.md +21 -0
  20. package/generated-docs/react/{carouselviewprops.orientation.md → carousellayoutprops.orientation.md} +1 -1
  21. package/generated-docs/react/{carouselviewprops.tracks.md → carousellayoutprops.tracks.md} +1 -1
  22. package/generated-docs/react/carouselview.md +15 -0
  23. package/generated-docs/react/chatprops.md +2 -2
  24. package/generated-docs/react/component/audiotrack.md +11 -4
  25. package/generated-docs/react/component/audiovisualizer.md +18 -1
  26. package/generated-docs/react/component/{carouselview.md → carousellayout.md} +8 -4
  27. package/generated-docs/react/component/chattoggle.md +5 -1
  28. package/generated-docs/react/component/clearpinbutton.md +3 -3
  29. package/generated-docs/react/component/connectionqualityindicator.md +1 -1
  30. package/generated-docs/react/component/connectionstate.md +1 -1
  31. package/generated-docs/react/component/connectionstatetoast.md +2 -0
  32. package/generated-docs/react/component/controlbar.md +1 -1
  33. package/generated-docs/react/component/disconnectbutton.md +1 -1
  34. package/generated-docs/react/component/focuslayout.md +7 -0
  35. package/generated-docs/react/component/focuslayoutcontainer.md +2 -0
  36. package/generated-docs/react/component/focustoggle.md +14 -3
  37. package/generated-docs/react/component/gridlayout.md +5 -1
  38. package/generated-docs/react/component/livekitroom.md +1 -1
  39. package/generated-docs/react/component/mediadevicemenu.md +1 -1
  40. package/generated-docs/react/component/mediadeviceselect.md +1 -1
  41. package/generated-docs/react/component/participantaudiotile.md +6 -1
  42. package/generated-docs/react/component/participantcontextifneeded.md +11 -1
  43. package/generated-docs/react/component/participantloop.md +1 -1
  44. package/generated-docs/react/component/participantname.md +1 -1
  45. package/generated-docs/react/component/participanttile.md +20 -5
  46. package/generated-docs/react/component/prejoin.md +7 -2
  47. package/generated-docs/react/component/roomaudiorenderer.md +1 -1
  48. package/generated-docs/react/component/roomname.md +1 -1
  49. package/generated-docs/react/component/startaudio.md +1 -1
  50. package/generated-docs/react/component/toast.md +9 -1
  51. package/generated-docs/react/component/trackloop.md +6 -6
  52. package/generated-docs/react/component/trackmutedindicator.md +11 -4
  53. package/generated-docs/react/component/tracktoggle.md +1 -1
  54. package/generated-docs/react/component/videoconference.md +2 -2
  55. package/generated-docs/react/component/videotrack.md +12 -5
  56. package/generated-docs/react/focuslayoutcontainerprops.focustrack.md +6 -0
  57. package/generated-docs/react/focuslayoutcontainerprops.participants.md +6 -0
  58. package/generated-docs/react/focuslayoutprops.md +5 -4
  59. package/generated-docs/react/focuslayoutprops.track.md +6 -0
  60. package/generated-docs/react/focuslayoutprops.trackref.md +13 -0
  61. package/generated-docs/react/focustoggleprops.md +5 -4
  62. package/generated-docs/react/focustoggleprops.participant.md +6 -0
  63. package/generated-docs/react/focustoggleprops.trackref.md +9 -0
  64. package/generated-docs/react/focustoggleprops.tracksource.md +7 -1
  65. package/generated-docs/react/hook/usechat.md +7 -1
  66. package/generated-docs/react/hook/usechattoggle.md +6 -0
  67. package/generated-docs/react/hook/useclearpinbutton.md +2 -0
  68. package/generated-docs/react/hook/useconnectionqualityindicator.md +12 -59
  69. package/generated-docs/react/hook/usedatachannel.md +14 -1
  70. package/generated-docs/react/hook/usedatachannel_1.md +14 -1
  71. package/generated-docs/react/hook/usedisconnectbutton.md +10 -1
  72. package/generated-docs/react/hook/useensuretrackref.md +24 -0
  73. package/generated-docs/react/hook/useensuretrackreference.md +4 -0
  74. package/generated-docs/react/hook/usefocustoggle.md +11 -2
  75. package/generated-docs/react/hook/usegridlayout.md +8 -2
  76. package/generated-docs/react/hook/useismuted.md +10 -5
  77. package/generated-docs/react/hook/useismuted_1.md +29 -0
  78. package/generated-docs/react/hook/useisspeaking.md +9 -1
  79. package/generated-docs/react/hook/uselivekitroom.md +10 -1
  80. package/generated-docs/react/hook/uselocalparticipant.md +8 -2
  81. package/generated-docs/react/hook/uselocalparticipantpermissions.md +9 -1
  82. package/generated-docs/react/hook/usemaybetrackcontext.md +4 -0
  83. package/generated-docs/react/hook/usemaybetrackrefcontext.md +19 -0
  84. package/generated-docs/react/hook/usemediadevices.md +10 -1
  85. package/generated-docs/react/hook/usemediadeviceselect.md +11 -1
  86. package/generated-docs/react/hook/usemediatrack.md +4 -0
  87. package/generated-docs/react/hook/usemediatrackbyname.md +4 -0
  88. package/generated-docs/react/hook/useparticipants.md +15 -2
  89. package/generated-docs/react/hook/useparticipanttile.md +7 -1
  90. package/generated-docs/react/hook/usepinnedtracks.md +13 -1
  91. package/generated-docs/react/hook/useremoteparticipant.md +13 -1
  92. package/generated-docs/react/hook/useremoteparticipants.md +15 -2
  93. package/generated-docs/react/hook/usesortedparticipants.md +1 -1
  94. package/generated-docs/react/hook/usespeakingparticipants.md +8 -2
  95. package/generated-docs/react/hook/usetoken.md +9 -1
  96. package/generated-docs/react/hook/usetrack.md +31 -0
  97. package/generated-docs/react/hook/usetrackbyname.md +31 -0
  98. package/generated-docs/react/hook/usetrackcontext.md +5 -1
  99. package/generated-docs/react/hook/usetrackmutedindicator.md +11 -9
  100. package/generated-docs/react/hook/usetrackmutedindicator_1.md +29 -0
  101. package/generated-docs/react/hook/usetrackrefcontext.md +19 -0
  102. package/generated-docs/react/hook/usetracktoggle.md +10 -1
  103. package/generated-docs/react/hook/usevisualstableupdate.md +13 -6
  104. package/generated-docs/react/index.md +163 -155
  105. package/generated-docs/react/localuserchoices.md +2 -0
  106. package/generated-docs/react/meta-data.json +1 -1
  107. package/generated-docs/react/participanttileprops.md +8 -7
  108. package/generated-docs/react/participanttileprops.participant.md +6 -0
  109. package/generated-docs/react/participanttileprops.publication.md +6 -0
  110. package/generated-docs/react/participanttileprops.source.md +6 -0
  111. package/generated-docs/react/participanttileprops.trackref.md +13 -0
  112. package/generated-docs/react/prejoinprops.md +12 -11
  113. package/generated-docs/react/prejoinprops.showe2eeoptions.md +9 -0
  114. package/generated-docs/react/trackcontext.md +4 -0
  115. package/generated-docs/react/trackmutedindicatorprops.md +6 -5
  116. package/generated-docs/react/trackmutedindicatorprops.participant.md +6 -0
  117. package/generated-docs/react/trackmutedindicatorprops.source.md +7 -1
  118. package/generated-docs/react/trackmutedindicatorprops.trackref.md +9 -0
  119. package/generated-docs/react/trackrefcontext.md +13 -0
  120. package/generated-docs/react/usefocustoggleprops.md +6 -5
  121. package/generated-docs/react/usefocustoggleprops.participant.md +6 -0
  122. package/generated-docs/react/usefocustoggleprops.trackref.md +9 -0
  123. package/generated-docs/react/usefocustoggleprops.tracksource.md +7 -1
  124. package/generated-docs/react/useparticipantinfooptions.md +9 -1
  125. package/generated-docs/react/useparticipantpermissionsoptions.md +9 -1
  126. package/generated-docs/react/useparticipanttileprops.md +9 -8
  127. package/generated-docs/react/useparticipanttileprops.participant.md +7 -1
  128. package/generated-docs/react/useparticipanttileprops.publication.md +6 -0
  129. package/generated-docs/react/useparticipanttileprops.source.md +7 -1
  130. package/generated-docs/react/useparticipanttileprops.trackref.md +13 -0
  131. package/generated-docs/react/useremoteparticipantoptions.md +3 -3
  132. package/generated-docs/react/useremoteparticipantoptions.updateonlyon.md +4 -0
  133. package/generated-docs/react/useroominfooptions.md +13 -1
  134. package/generated-docs/react/usetrackmutedindicatoroptions.participant.md +6 -0
  135. package/generated-docs/react/usetrackoptions.element.md +9 -0
  136. package/generated-docs/react/usetrackoptions.md +18 -0
  137. package/generated-docs/react/usetrackoptions.props.md +9 -0
  138. package/generated-docs/react/videoconferenceprops.md +2 -2
  139. package/generated-docs/react/videotrackprops.md +10 -9
  140. package/generated-docs/react/videotrackprops.name.md +6 -0
  141. package/generated-docs/react/videotrackprops.participant.md +6 -0
  142. package/generated-docs/react/videotrackprops.publication.md +6 -0
  143. package/generated-docs/react/videotrackprops.source.md +7 -1
  144. package/generated-docs/react/videotrackprops.trackref.md +13 -0
  145. package/package.json +1 -1
  146. package/generated-docs/react/carouselviewprops.md +0 -21
  147. /package/generated-docs/{react → core}/messagedecoder.md +0 -0
  148. /package/generated-docs/{react → core}/messageencoder.md +0 -0
@@ -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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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
 
@@ -2,20 +2,25 @@
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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
13
+ ## Usage
12
14
 
13
- ## Parameters
15
+ ```tsx
16
+ const isMuted = useIsMuted(track);
17
+ ```
14
18
 
15
- {% parameter name="source" type="Track.Source" optional=false %}
16
- {% /parameter %}
19
+ {% partial file="p_usage.md" variables={exampleCount: 1} /%}
20
+
21
+ ## Parameters
17
22
 
18
- {% parameter name="options" type="UseIsMutedOptions" optional=true %}
23
+ {% parameter name="trackRef" type="TrackReferenceOrPlaceholder" optional=false %}
19
24
  {% /parameter %}
20
25
 
21
26
  ## Returns
@@ -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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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
 
@@ -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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # useLocalParticipant
4
4
 
5
- The useLocalParticipant hook the state of the local participant.
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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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
 
@@ -2,13 +2,21 @@
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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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
 
@@ -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
@@ -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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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
 
@@ -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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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
 
@@ -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
@@ -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
@@ -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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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
 
@@ -2,17 +2,23 @@
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
@@ -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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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
 
@@ -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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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
 
@@ -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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # useSortedParticipants
4
4
 
5
- The useSortedParticipants hook returns the only the active speakers of all participants.
5
+ The `useSortedParticipants` hook returns the participants sorted by importance.
6
6
 
7
7
  ## Import
8
8
 
@@ -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,7 +10,13 @@ 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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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
 
@@ -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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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
 
@@ -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
- Ensures that a track reference is provided via context. If not inside a `TrackContext`<!-- -->, an error is thrown.
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
 
@@ -2,27 +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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
13
+ ## Usage
12
14
 
13
- ## Parameters
15
+ ```tsx
16
+ const { isMuted } = useTrackMutedIndicator(trackRef);
17
+ ```
14
18
 
15
- {% parameter name="source" type="Track.Source" optional=false %}
16
- {% /parameter %}
19
+ {% partial file="p_usage.md" variables={exampleCount: 1} /%}
20
+
21
+ ## Parameters
17
22
 
18
- {% parameter name="options" type="UseTrackMutedIndicatorOptions" optional=true %}
23
+ {% parameter name="trackRef" type="TrackReferenceOrPlaceholder" optional=true %}
19
24
  {% /parameter %}
20
25
 
21
26
  ## Returns
22
27
 
23
28
  ```typescript
24
- {
25
- isMuted: boolean;
26
- className: string;
27
- }
29
+ TrackMutedIndicatorReturnType;
28
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
+ ```