@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
  # PreJoin
4
4
 
5
- The PreJoin prefab component is normally presented to the user before he enters a room. This component allows the user to check and select the preferred media device (camera und microphone). On submit the user decisions are returned, which can then be passed on to the LiveKitRoom so that the user enters the room with the correct media devices.
5
+ The `PreJoin` prefab component is normally presented to the user before he enters a room. This component allows the user to check and select the preferred media device (camera und microphone). On submit the user decisions are returned, which can then be passed on to the `LiveKitRoom` so that the user enters the room with the correct media devices.
6
6
 
7
7
  ## Import
8
8
 
@@ -12,7 +12,7 @@ import { PreJoin } from '@livekit/components-react';
12
12
 
13
13
  ## Remarks
14
14
 
15
- This component is independent from the LiveKitRoom component and don't has to be nested inside it. Because it only access the local media tracks this component is self contained and works without connection to the LiveKit server.
15
+ This component is independent from the `LiveKitRoom` component and don't has to be nested inside it. Because it only access the local media tracks this component is self contained and works without connection to the LiveKit server.
16
16
 
17
17
  ## Usage
18
18
 
@@ -64,6 +64,11 @@ _(Optional)_ Provide your custom validation function. Only if validation is succ
64
64
 
65
65
  {% /parameter %}
66
66
 
67
+ {% parameter name="showE2EEOptions" type="boolean" optional=true %}
68
+ _(Optional)_
69
+
70
+ {% /parameter %}
71
+
67
72
  {% parameter name="userLabel" type="string" optional=true %}
68
73
  _(Optional)_
69
74
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # RoomAudioRenderer
4
4
 
5
- The RoomAudioRenderer component is a drop-in solution for adding audio to your LiveKit app. It takes care of handling remote participants’ audio tracks and makes sure that microphones and screen share are audible.
5
+ The `RoomAudioRenderer` component is a drop-in solution for adding audio to your LiveKit app. It takes care of handling remote participants’ audio tracks and makes sure that microphones and screen share are audible.
6
6
 
7
7
  ## Import
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # RoomName
4
4
 
5
- The RoomName component renders the name of the connected LiveKit room inside a span tag.
5
+ The `RoomName` component renders the name of the connected LiveKit room inside a span tag.
6
6
 
7
7
  ## Import
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # StartAudio
4
4
 
5
- The StartAudio component is only visible when the browser blocks audio playback. This is due to some browser implemented autoplay policies. To start audio playback, the user must perform a user-initiated event such as clicking this button. As soon as audio playback starts, the button hides itself again.
5
+ The `StartAudio` component is only visible when the browser blocks audio playback. This is due to some browser implemented autoplay policies. To start audio playback, the user must perform a user-initiated event such as clicking this button. As soon as audio playback starts, the button hides itself again.
6
6
 
7
7
  ## Import
8
8
 
@@ -2,10 +2,18 @@
2
2
 
3
3
  # Toast
4
4
 
5
+ The `Toast` component is a rudimentary way to display a message to the user. This message should be short lived and not require user interaction. For example, displaying the current connection state like `ConnectionStateToast` does.
6
+
5
7
  ## Import
6
8
 
7
9
  ```typescript
8
10
  import { Toast } from '@livekit/components-react';
9
11
  ```
10
12
 
11
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
13
+ ## Usage
14
+
15
+ ```tsx
16
+ <Toast>Connecting...</Toast>
17
+ ```
18
+
19
+ {% partial file="p_usage.md" variables={exampleCount: 1} /%}
@@ -2,7 +2,7 @@
2
2
 
3
3
  # TrackLoop
4
4
 
5
- The TrackLoop component loops over tracks. It is for example a easy way to loop over all participant camera and screen share tracks. TrackLoop creates a TrackContext for each track that you can use to e.g. render the track.
5
+ The `TrackLoop` component loops over tracks. It is for example a easy way to loop over all participant camera and screen share tracks. `TrackLoop` creates a `TrackRefContext` for each track that you can use to e.g. render the track.
6
6
 
7
7
  ## Import
8
8
 
@@ -13,11 +13,11 @@ import { TrackLoop } from '@livekit/components-react';
13
13
  ## Usage
14
14
 
15
15
  ```tsx
16
- const tracks = useTracks([Track.Source.Camera]);
17
- <TrackLoop tracks={tracks} >
18
- <TrackContext.Consumer>
19
- {(track) => track && <VideoTrack {...track}/>}
20
- </TrackContext.Consumer>
16
+ const trackRefs = useTracks([Track.Source.Camera]);
17
+ <TrackLoop tracks={trackRefs} >
18
+ <TrackRefContext.Consumer>
19
+ {(trackRef) => trackRef && <VideoTrack trackRef={trackRef}/>}
20
+ </TrackRefContext.Consumer>
21
21
  <TrackLoop />
22
22
  ```
23
23
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # TrackMutedIndicator
4
4
 
5
- The TrackMutedIndicator shows whether the participant's camera or microphone is muted or not.
5
+ The `TrackMutedIndicator` shows whether the participant's camera or microphone is muted or not. By default, a muted/unmuted icon is displayed for a camera, microphone, and screen sharing track.
6
6
 
7
7
  ## Import
8
8
 
@@ -21,9 +21,6 @@ import { TrackMutedIndicator } from '@livekit/components-react';
21
21
 
22
22
  ## Properties
23
23
 
24
- {% parameter name="source" type="Track.Source" optional=false %}
25
- {% /parameter %}
26
-
27
24
  {% parameter name="participant" type="Participant" optional=true %}
28
25
  _(Optional)_
29
26
 
@@ -33,3 +30,13 @@ _(Optional)_
33
30
  _(Optional)_
34
31
 
35
32
  {% /parameter %}
33
+
34
+ {% parameter name="source" type="Track.Source" optional=true %}
35
+ _(Optional)_
36
+
37
+ {% /parameter %}
38
+
39
+ {% parameter name="trackRef" type="TrackReferenceOrPlaceholder" optional=true %}
40
+ _(Optional)_
41
+
42
+ {% /parameter %}
@@ -2,7 +2,7 @@
2
2
 
3
3
  # TrackToggle
4
4
 
5
- With the TrackToggle component it is possible to mute and unmute your camera and microphone. The component uses an html button element under the hood so you can treat it like a button.
5
+ With the `TrackToggle` component it is possible to mute and unmute your camera and microphone. The component uses an html button element under the hood so you can treat it like a button.
6
6
 
7
7
  ## Import
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # VideoConference
4
4
 
5
- This component is the default setup of a classic LiveKit video conferencing app. It provides functionality like switching between participant grid view and focus view.
5
+ The `VideoConference` ready-made component is your drop-in solution for a classic video conferencing application. It provides functionality such as focusing on one participant, grid view with pagination to handle large numbers of participants, basic non-persistent chat, screen sharing, and more.
6
6
 
7
7
  ## Import
8
8
 
@@ -12,7 +12,7 @@ import { VideoConference } from '@livekit/components-react';
12
12
 
13
13
  ## Remarks
14
14
 
15
- The component is implemented with other LiveKit components like `FocusContextProvider`<!-- -->, `GridLayout`<!-- -->, `ControlBar`<!-- -->, `FocusLayoutContainer` and `FocusLayout`<!-- -->.
15
+ The component is implemented with other LiveKit components like `FocusContextProvider`<!-- -->, `GridLayout`<!-- -->, `ControlBar`<!-- -->, `FocusLayoutContainer` and `FocusLayout`<!-- -->. You can use this components as a starting point for your own custom video conferencing application.
16
16
 
17
17
  ## Usage
18
18
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # VideoTrack
4
4
 
5
- The VideoTrack component is responsible for rendering participant video tracks like `camera` and `screen_share`<!-- -->. This component must have access to the participant's context, or alternatively pass it a `Participant` as a property.
5
+ The `VideoTrack` component is responsible for rendering participant video tracks like `camera` and `screen_share`<!-- -->. This component must have access to the participant's context, or alternatively pass it a `Participant` as a property.
6
6
 
7
7
  ## Import
8
8
 
@@ -13,16 +13,13 @@ import { VideoTrack } from '@livekit/components-react';
13
13
  ## Usage
14
14
 
15
15
  ```tsx
16
- <VideoTrack source={Track.Source.Camera} />
16
+ <VideoTrack trackRef={trackRef} />
17
17
  ```
18
18
 
19
19
  {% partial file="p_usage.md" variables={exampleCount: 1} /%}
20
20
 
21
21
  ## Properties
22
22
 
23
- {% parameter name="source" type="Track.Source" optional=false %}
24
- {% /parameter %}
25
-
26
23
  {% parameter name="manageSubscription" type="boolean" optional=true %}
27
24
  _(Optional)_
28
25
 
@@ -52,3 +49,13 @@ _(Optional)_
52
49
  _(Optional)_
53
50
 
54
51
  {% /parameter %}
52
+
53
+ {% parameter name="source" type="Track.Source" optional=true %}
54
+ _(Optional)_
55
+
56
+ {% /parameter %}
57
+
58
+ {% parameter name="trackRef" type="TrackReference" optional=true %}
59
+ _(Optional)_ The track reference of the track to render.
60
+
61
+ {% /parameter %}
@@ -2,8 +2,14 @@
2
2
 
3
3
  ## FocusLayoutContainerProps.focusTrack property
4
4
 
5
+ > Warning: This API is now obsolete.
6
+ >
7
+ > This property has no effect and will be removed in a future version.
8
+
5
9
  **Signature:**
6
10
 
7
11
  ```typescript
8
12
  focusTrack?: TrackReference;
9
13
  ```
14
+
15
+ {% partial file="p_usage.md" variables={exampleCount: 0} /%}
@@ -2,8 +2,14 @@
2
2
 
3
3
  ## FocusLayoutContainerProps.participants property
4
4
 
5
+ > Warning: This API is now obsolete.
6
+ >
7
+ > This property has no effect and will be removed in a future version.
8
+
5
9
  **Signature:**
6
10
 
7
11
  ```typescript
8
12
  participants?: Array<Participant>;
9
13
  ```
14
+
15
+ {% partial file="p_usage.md" variables={exampleCount: 0} /%}
@@ -14,7 +14,8 @@ export interface FocusLayoutProps extends React.HTMLAttributes<HTMLElement>
14
14
 
15
15
  ## Properties
16
16
 
17
- | Property | Type | Description |
18
- | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------ |
19
- | [onParticipantClick?](./react/focuslayoutprops.onparticipantclick.md) | (evt: [ParticipantClickEvent](./core/participantclickevent.md)<!-- -->) =&gt; void | _(Optional)_ |
20
- | [track?](./react/focuslayoutprops.track.md) | [TrackReferenceOrPlaceholder](./core/trackreferenceorplaceholder.md) | _(Optional)_ |
17
+ | Property | Type | Description |
18
+ | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------ |
19
+ | [onParticipantClick?](./react/focuslayoutprops.onparticipantclick.md) | (evt: [ParticipantClickEvent](./core/participantclickevent.md)<!-- -->) =&gt; void | _(Optional)_ |
20
+ | [track?](./react/focuslayoutprops.track.md) | [TrackReferenceOrPlaceholder](./core/trackreferenceorplaceholder.md) | _(Optional)_ |
21
+ | [trackRef?](./react/focuslayoutprops.trackref.md) | [TrackReferenceOrPlaceholder](./core/trackreferenceorplaceholder.md) | _(Optional)_ The track to display in the focus layout. |
@@ -2,8 +2,14 @@
2
2
 
3
3
  ## FocusLayoutProps.track property
4
4
 
5
+ > Warning: This API is now obsolete.
6
+ >
7
+ > This property will be removed in a future version use `trackRef` instead.
8
+
5
9
  **Signature:**
6
10
 
7
11
  ```typescript
8
12
  track?: TrackReferenceOrPlaceholder;
9
13
  ```
14
+
15
+ {% partial file="p_usage.md" variables={exampleCount: 0} /%}
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ ## FocusLayoutProps.trackRef property
4
+
5
+ The track to display in the focus layout.
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ trackRef?: TrackReferenceOrPlaceholder;
11
+ ```
12
+
13
+ {% partial file="p_usage.md" variables={exampleCount: 0} /%}
@@ -14,7 +14,8 @@ export interface FocusToggleProps extends React.ButtonHTMLAttributes<HTMLButtonE
14
14
 
15
15
  ## Properties
16
16
 
17
- | Property | Type | Description |
18
- | ------------------------------------------------------- | ------------ | ------------ |
19
- | [participant?](./react/focustoggleprops.participant.md) | Participant | _(Optional)_ |
20
- | [trackSource](./react/focustoggleprops.tracksource.md) | Track.Source | |
17
+ | Property | Type | Description |
18
+ | ------------------------------------------------------- | -------------------------------------------------------------------- | ------------ |
19
+ | [participant?](./react/focustoggleprops.participant.md) | Participant | _(Optional)_ |
20
+ | [trackRef?](./react/focustoggleprops.trackref.md) | [TrackReferenceOrPlaceholder](./core/trackreferenceorplaceholder.md) | _(Optional)_ |
21
+ | [trackSource?](./react/focustoggleprops.tracksource.md) | Track.Source | _(Optional)_ |
@@ -2,8 +2,14 @@
2
2
 
3
3
  ## FocusToggleProps.participant property
4
4
 
5
+ > Warning: This API is now obsolete.
6
+ >
7
+ > This parameter will be removed in a future version use `trackRef` instead.
8
+
5
9
  **Signature:**
6
10
 
7
11
  ```typescript
8
12
  participant?: Participant;
9
13
  ```
14
+
15
+ {% partial file="p_usage.md" variables={exampleCount: 0} /%}
@@ -0,0 +1,9 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ ## FocusToggleProps.trackRef property
4
+
5
+ **Signature:**
6
+
7
+ ```typescript
8
+ trackRef?: TrackReferenceOrPlaceholder;
9
+ ```
@@ -2,8 +2,14 @@
2
2
 
3
3
  ## FocusToggleProps.trackSource property
4
4
 
5
+ > Warning: This API is now obsolete.
6
+ >
7
+ > This parameter will be removed in a future version use `trackRef` instead.
8
+
5
9
  **Signature:**
6
10
 
7
11
  ```typescript
8
- trackSource: Track.Source;
12
+ trackSource?: Track.Source;
9
13
  ```
14
+
15
+ {% partial file="p_usage.md" variables={exampleCount: 0} /%}
@@ -2,12 +2,18 @@
2
2
 
3
3
  # useChat
4
4
 
5
+ The `useChat` hook provides chat functionality for a LiveKit room. It returns a simple `send` function to send chat messages and an array of `chatMessages` to hold received messages.
6
+
5
7
  ## Import
6
8
 
7
9
  ```typescript
8
10
  import { useChat } from '@livekit/components-react';
9
11
  ```
10
12
 
13
+ ## Remarks
14
+
15
+ It is possible to pass configurations for custom message encoding and decoding.
16
+
11
17
  {% partial file="p_usage.md" variables={exampleCount: 0} /%}
12
18
 
13
19
  ## Parameters
@@ -23,7 +29,7 @@ import { useChat } from '@livekit/components-react';
23
29
  ```typescript
24
30
  {
25
31
  send: ((message: string) => Promise<void>) | undefined;
26
- chatMessages: ReceivedChatMessage[];
32
+ chatMessages: import("@livekit/components-core").ReceivedChatMessage[];
27
33
  isSending: boolean;
28
34
  }
29
35
  ```
@@ -2,12 +2,18 @@
2
2
 
3
3
  # useChatToggle
4
4
 
5
+ The `useChatToggle` hook provides state and functions for toggling the chat window.
6
+
5
7
  ## Import
6
8
 
7
9
  ```typescript
8
10
  import { useChatToggle } from '@livekit/components-react';
9
11
  ```
10
12
 
13
+ ## Remarks
14
+
15
+ Depends on the `LayoutContext` to work properly.
16
+
11
17
  {% partial file="p_usage.md" variables={exampleCount: 0} /%}
12
18
 
13
19
  ## Parameters
@@ -2,6 +2,8 @@
2
2
 
3
3
  # useClearPinButton
4
4
 
5
+ The `useClearPinButton` hook provides props for the [ClearPinButton()](./react/component/clearpinbutton.md) or your custom implementation of it component. It adds the `onClick` handler to signal the `LayoutContext` that the tile in focus should be cleared.
6
+
5
7
  ## Import
6
8
 
7
9
  ```typescript
@@ -2,13 +2,23 @@
2
2
 
3
3
  # useConnectionQualityIndicator
4
4
 
5
+ The `useConnectionQualityIndicator` hook provides props for the `ConnectionQualityIndicator` or your custom implementation of it component.
6
+
5
7
  ## Import
6
8
 
7
9
  ```typescript
8
10
  import { useConnectionQualityIndicator } from '@livekit/components-react';
9
11
  ```
10
12
 
11
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
13
+ ## Usage
14
+
15
+ ```tsx
16
+ const { quality } = useConnectionQualityIndicator();
17
+ // or
18
+ const { quality } = useConnectionQualityIndicator({ participant });
19
+ ```
20
+
21
+ {% partial file="p_usage.md" variables={exampleCount: 1} /%}
12
22
 
13
23
  ## Parameters
14
24
 
@@ -19,64 +29,7 @@ import { useConnectionQualityIndicator } from '@livekit/components-react';
19
29
 
20
30
  ```typescript
21
31
  {
22
- className: 'lk-rotate' |
23
- 'lk-audio-conference' |
24
- 'lk-audio-conference-stage' |
25
- 'lk-audio-container' |
26
- 'lk-button' |
27
- 'lk-button-group' |
28
- 'lk-button-group-container' |
29
- 'lk-camera-off-note' |
30
- 'lk-chat' |
31
- 'lk-chat-entry' |
32
- 'lk-chat-form' |
33
- 'lk-chat-form-input' |
34
- 'lk-chat-messages' |
35
- 'lk-control-bar' |
36
- 'lk-focus-layout-wrapper' |
37
- 'lk-form-control' |
38
- 'lk-grid-layout-wrapper' |
39
- 'lk-join-button' |
40
- 'lk-list' |
41
- 'lk-message-body' |
42
- 'lk-meta-data' |
43
- 'lk-participant-name' |
44
- 'lk-prejoin' |
45
- 'lk-timestamp' |
46
- 'lk-username-container' |
47
- 'lk-video-conference' |
48
- 'lk-video-conference-inner' |
49
- 'lk-video-container' |
50
- 'lk-audio-visualizer' |
51
- 'lk-button-group-menu' |
52
- 'lk-button-menu' |
53
- 'lk-carousel' |
54
- 'lk-chat-toggle' |
55
- 'lk-connection-quality' |
56
- 'lk-device-menu' |
57
- 'lk-device-menu-heading' |
58
- 'lk-disconnect-button' |
59
- 'lk-focus-layout' |
60
- 'lk-focus-toggle-button' |
61
- 'lk-focused-participant' |
62
- 'lk-grid-layout' |
63
- 'lk-media-device-select' |
64
- 'lk-pagination-control' |
65
- 'lk-pagination-count' |
66
- 'lk-pagination-indicator' |
67
- 'lk-participant-media-audio' |
68
- 'lk-participant-media-video' |
69
- 'lk-participant-metadata' |
70
- 'lk-participant-metadata-item' |
71
- 'lk-participant-placeholder' |
72
- 'lk-participant-tile' |
73
- 'lk-pip-track' |
74
- 'lk-room-container' |
75
- 'lk-spinner' |
76
- 'lk-start-audio-button' |
77
- 'lk-toast' |
78
- 'lk-track-muted-indicator-camera' |
79
- 'lk-track-muted-indicator-microphone';
32
+ className: 'lk-connection-quality';
80
33
  quality: ConnectionQuality;
81
34
  }
82
35
  ```
@@ -2,13 +2,26 @@
2
2
 
3
3
  # useDataChannel
4
4
 
5
+ The `useDataChannel` hook returns the ability to send and receive messages. By optionally passing a `topic`<!-- -->, you can narrow down which messages are returned in the messages array.
6
+
5
7
  ## Import
6
8
 
7
9
  ```typescript
8
10
  import { useDataChannel } from '@livekit/components-react';
9
11
  ```
10
12
 
11
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
13
+ ## Remarks
14
+
15
+ There is only one data channel. Passing a `topic` does not open a new data channel. It is only used to filter out messages with no or a different `topic`<!-- -->.
16
+
17
+ ## Usage
18
+
19
+ ```tsx
20
+ // Send messages to all participants via the 'chat' topic.
21
+ const { message, send } = useDataChannel('chat');
22
+ ```
23
+
24
+ {% partial file="p_usage.md" variables={exampleCount: 1} /%}
12
25
 
13
26
  ## Parameters
14
27
 
@@ -2,13 +2,26 @@
2
2
 
3
3
  # useDataChannel
4
4
 
5
+ The `useDataChannel` hook returns the ability to send and receive messages.
6
+
5
7
  ## Import
6
8
 
7
9
  ```typescript
8
10
  import { useDataChannel } from '@livekit/components-react';
9
11
  ```
10
12
 
11
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
13
+ ## Remarks
14
+
15
+ There is only one data channel. Passing a `topic` does not open a new data channel. It is only used to filter out messages with no or a different `topic`<!-- -->.
16
+
17
+ ## Usage
18
+
19
+ ```tsx
20
+ // Send messages to all participants
21
+ const { message, send } = useDataChannel(callback);
22
+ ```
23
+
24
+ {% partial file="p_usage.md" variables={exampleCount: 1} /%}
12
25
 
13
26
  ## Parameters
14
27
 
@@ -2,13 +2,22 @@
2
2
 
3
3
  # useDisconnectButton
4
4
 
5
+ The `useDisconnectButton` hook is used to implement the `DisconnectButton` or your custom implementation of it. It adds onClick handler to the button to disconnect from the room.
6
+
5
7
  ## Import
6
8
 
7
9
  ```typescript
8
10
  import { useDisconnectButton } from '@livekit/components-react';
9
11
  ```
10
12
 
11
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
13
+ ## Usage
14
+
15
+ ```tsx
16
+ const { buttonProps } = useDisconnectButton();
17
+ return <button {...buttonProps}>Disconnect</button>;
18
+ ```
19
+
20
+ {% partial file="p_usage.md" variables={exampleCount: 1} /%}
12
21
 
13
22
  ## Parameters
14
23
 
@@ -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
@@ -2,17 +2,26 @@
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
- {% partial file="p_usage.md" variables={exampleCount: 0} /%}
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