@livekit/components-js-docs 0.1.37 → 0.1.39
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/chatoptions.md +3 -3
- package/generated-docs/core/createchatobserver.md +23 -0
- package/generated-docs/core/index.md +4 -1
- package/generated-docs/core/{chatmessage.id.md → legacychatmessage.ignore.md} +3 -3
- package/generated-docs/core/legacychatmessage.md +24 -0
- package/generated-docs/core/{chatmessage.message.md → legacyreceivedchatmessage.ignore.md} +3 -3
- package/generated-docs/core/legacyreceivedchatmessage.md +24 -0
- package/generated-docs/core/messagedecoder.md +10 -2
- package/generated-docs/core/messageencoder.md +10 -2
- package/generated-docs/core/receivedchatmessage.md +4 -5
- package/generated-docs/core/setupchat.md +9 -1
- package/generated-docs/core/setupchatmessagehandler.md +33 -0
- package/generated-docs/react/{voiceassistantstate.md → agentstate.md} +5 -3
- package/generated-docs/react/{chatmessage.id.md → allowmediaplaybackprops.label.md} +3 -3
- package/generated-docs/react/allowmediaplaybackprops.md +26 -0
- package/generated-docs/react/barvisualizerprops.md +1 -1
- package/generated-docs/react/barvisualizerprops.state.md +1 -1
- package/generated-docs/react/component/barvisualizer.md +1 -1
- package/generated-docs/react/component/controlbar.md +1 -1
- package/generated-docs/react/component/participantloop.md +1 -1
- package/generated-docs/react/component/prejoin.md +1 -1
- package/generated-docs/react/component/startmediabutton.md +35 -0
- package/generated-docs/react/component/trackloop.md +5 -5
- package/generated-docs/react/component/videoconference.md +1 -1
- package/generated-docs/react/component/voiceassistantcontrolbar.md +10 -2
- package/generated-docs/react/controlbarprops.md +6 -6
- package/generated-docs/react/controlbarprops.saveuserchoices.md +1 -1
- package/generated-docs/react/hook/usechat.md +7 -6
- package/generated-docs/react/hook/usevoiceassistant.md +11 -3
- package/generated-docs/react/index.md +42 -42
- package/generated-docs/react/messagedecoder.md +9 -3
- package/generated-docs/react/messageencoder.md +9 -3
- package/generated-docs/react/meta-data.json +1 -1
- package/generated-docs/react/receivedchatmessage.md +4 -5
- package/generated-docs/react/voiceassistant.agent.md +2 -0
- package/generated-docs/react/voiceassistant.agentattributes.md +2 -0
- package/generated-docs/react/voiceassistant.agenttranscriptions.md +2 -0
- package/generated-docs/react/voiceassistant.audiotrack.md +2 -0
- package/generated-docs/react/voiceassistant.md +9 -7
- package/generated-docs/react/voiceassistant.state.md +3 -1
- package/generated-docs/react/voiceassistantcontrolbarprops.md +5 -5
- package/generated-docs/react/voiceassistantcontrolbarprops.saveuserchoices.md +2 -0
- package/package.json +2 -2
- package/generated-docs/core/chatmessage.md +0 -26
- package/generated-docs/core/chatmessage.timestamp.md +0 -13
- package/generated-docs/core/receivedchatmessage.edittimestamp.md +0 -13
- package/generated-docs/react/chatmessage.md +0 -26
- package/generated-docs/react/chatmessage.message.md +0 -13
- package/generated-docs/react/chatmessage.timestamp.md +0 -13
- package/generated-docs/react/component/voiceassistantcontext.md +0 -18
- package/generated-docs/react/receivedchatmessage.edittimestamp.md +0 -13
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
export type ChatOptions = {
|
|
16
|
-
messageEncoder?: (message:
|
|
17
|
-
messageDecoder?: (message: Uint8Array) =>
|
|
16
|
+
messageEncoder?: (message: LegacyChatMessage) => Uint8Array;
|
|
17
|
+
messageDecoder?: (message: Uint8Array) => LegacyReceivedChatMessage;
|
|
18
18
|
channelTopic?: string;
|
|
19
19
|
updateChannelTopic?: string;
|
|
20
20
|
};
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
**References:** [
|
|
23
|
+
**References:** [LegacyChatMessage](./core/legacychatmessage.md)<!-- -->, [LegacyReceivedChatMessage](./core/legacyreceivedchatmessage.md)
|
|
24
24
|
|
|
25
25
|
{% partial file="p_usage.md" variables={exampleCount: 0} /%}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"title": "createChatObserver",
|
|
4
|
+
"linkToSource": "https://github.com/livekit/components-js/blob/main/packages/core/src/observables/room.ts"
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
9
|
+
|
|
10
|
+
# createChatObserver
|
|
11
|
+
|
|
12
|
+
**Signature:**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
export declare function createChatObserver(
|
|
16
|
+
room: Room
|
|
17
|
+
): Observable<
|
|
18
|
+
[
|
|
19
|
+
message: import("livekit-client").ChatMessage,
|
|
20
|
+
participant?: LocalParticipant | import("livekit-client").RemoteParticipant | undefined
|
|
21
|
+
]
|
|
22
|
+
>;
|
|
23
|
+
```
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
| [AudioSource](./core/audiosource.md) | |
|
|
21
21
|
| [BaseDataMessage](./core/basedatamessage.md) | |
|
|
22
22
|
| [CaptureOptionsBySource](./core/captureoptionsbysource.md) | |
|
|
23
|
-
| [ChatMessage](./core/chatmessage.md) | |
|
|
24
23
|
| [ChatOptions](./core/chatoptions.md) | |
|
|
25
24
|
| [computeMenuPosition(button, menu)](./core/computemenuposition.md) | |
|
|
26
25
|
| [connectedParticipantObserver(room, identity, options)](./core/connectedparticipantobserver.md) | |
|
|
@@ -28,6 +27,7 @@
|
|
|
28
27
|
| [connectedParticipantsObserver(room, options)](./core/connectedparticipantsobserver.md) | |
|
|
29
28
|
| [connectionStateObserver(room)](./core/connectionstateobserver.md) | |
|
|
30
29
|
| [createActiveDeviceObservable(room, kind)](./core/createactivedeviceobservable.md) | |
|
|
30
|
+
| [createChatObserver(room)](./core/createchatobserver.md) | |
|
|
31
31
|
| [createConnectionQualityObserver(participant)](./core/createconnectionqualityobserver.md) | |
|
|
32
32
|
| [createDataObserver(room)](./core/createdataobserver.md) | |
|
|
33
33
|
| [createDefaultGrammar()](./core/createdefaultgrammar.md) | |
|
|
@@ -58,6 +58,8 @@
|
|
|
58
58
|
| [isSourceWitOptions(source)](./core/issourcewitoptions.md) | |
|
|
59
59
|
| [isTrackReferencePinned(trackReference, pinState)](./core/istrackreferencepinned.md) | Check if the <code>TrackReference</code> is pinned. |
|
|
60
60
|
| [isTrackReferencePlaceholder(trackReference)](./core/istrackreferenceplaceholder.md) | |
|
|
61
|
+
| [LegacyChatMessage](./core/legacychatmessage.md) | |
|
|
62
|
+
| [LegacyReceivedChatMessage](./core/legacyreceivedchatmessage.md) | |
|
|
61
63
|
| [loadUserChoices(defaults, preventLoad)](./core/loaduserchoices.md) | Reads the user choices from local storage, or returns the default settings if none are found. |
|
|
62
64
|
| [LocalUserChoices](./core/localuserchoices.md) | Represents the user's choices for video and audio input devices, as well as their username. |
|
|
63
65
|
| [log](./core/log.md) | |
|
|
@@ -103,6 +105,7 @@
|
|
|
103
105
|
| [setLogLevel(level, options)](./core/setloglevel.md) | Set the log level for both the <code>@livekit/components-react</code> package and the <code>@livekit-client</code> package. To set the <code>@livekit-client</code> log independently, use the <code>liveKitClientLogLevel</code> prop on the <code>options</code> object. |
|
|
104
106
|
| [SetMediaDeviceOptions](./core/setmediadeviceoptions.md) | |
|
|
105
107
|
| [setupChat(room, options)](./core/setupchat.md) | |
|
|
108
|
+
| [setupChatMessageHandler(room)](./core/setupchatmessagehandler.md) | |
|
|
106
109
|
| [setupChatToggle()](./core/setupchattoggle.md) | |
|
|
107
110
|
| [setupClearPinButton()](./core/setupclearpinbutton.md) | |
|
|
108
111
|
| [setupConnectionQualityIndicator(participant)](./core/setupconnectionqualityindicator.md) | |
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
{ "title": "
|
|
2
|
+
{ "title": "LegacyChatMessage.ignore property" }
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# LegacyChatMessage.ignore property
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
ignore?: true;
|
|
13
13
|
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"title": "LegacyChatMessage interface",
|
|
4
|
+
"linkToSource": "https://github.com/livekit/components-js/blob/main/packages/core/src/components/chat.ts"
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
9
|
+
|
|
10
|
+
# LegacyChatMessage interface
|
|
11
|
+
|
|
12
|
+
**Signature:**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
export interface LegacyChatMessage extends ChatMessage
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Extends:** ChatMessage
|
|
19
|
+
|
|
20
|
+
## Properties
|
|
21
|
+
|
|
22
|
+
| Property | Type | Description |
|
|
23
|
+
| --------------------------------------------- | ---- | ------------ |
|
|
24
|
+
| [ignore?](./core/legacychatmessage.ignore.md) | true | _(Optional)_ |
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
{ "title": "
|
|
2
|
+
{ "title": "LegacyReceivedChatMessage.ignore property" }
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# LegacyReceivedChatMessage.ignore property
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
ignore?: true;
|
|
13
13
|
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"title": "LegacyReceivedChatMessage interface",
|
|
4
|
+
"linkToSource": "https://github.com/livekit/components-js/blob/main/packages/core/src/components/chat.ts"
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
9
|
+
|
|
10
|
+
# LegacyReceivedChatMessage interface
|
|
11
|
+
|
|
12
|
+
**Signature:**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
export interface LegacyReceivedChatMessage extends ReceivedChatMessage
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Extends:** [ReceivedChatMessage](./core/receivedchatmessage.md)
|
|
19
|
+
|
|
20
|
+
## Properties
|
|
21
|
+
|
|
22
|
+
| Property | Type | Description |
|
|
23
|
+
| ----------------------------------------------------- | ---- | ------------ |
|
|
24
|
+
| [ignore?](./core/legacyreceivedchatmessage.ignore.md) | true | _(Optional)_ |
|
|
@@ -9,12 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
# MessageDecoder type
|
|
11
11
|
|
|
12
|
+
{% callout type="caution" variation="normal" %}
|
|
13
|
+
|
|
14
|
+
This API is deprecated:
|
|
15
|
+
|
|
16
|
+
the new chat API doesn't rely on encoders and decoders anymore and uses a dedicated chat API instead
|
|
17
|
+
|
|
18
|
+
{% /callout %}
|
|
19
|
+
|
|
12
20
|
**Signature:**
|
|
13
21
|
|
|
14
22
|
```typescript
|
|
15
|
-
export type MessageDecoder = (message: Uint8Array) =>
|
|
23
|
+
export type MessageDecoder = (message: Uint8Array) => LegacyReceivedChatMessage;
|
|
16
24
|
```
|
|
17
25
|
|
|
18
|
-
**References:** [
|
|
26
|
+
**References:** [LegacyReceivedChatMessage](./core/legacyreceivedchatmessage.md)
|
|
19
27
|
|
|
20
28
|
{% partial file="p_usage.md" variables={exampleCount: 0} /%}
|
|
@@ -9,12 +9,20 @@
|
|
|
9
9
|
|
|
10
10
|
# MessageEncoder type
|
|
11
11
|
|
|
12
|
+
{% callout type="caution" variation="normal" %}
|
|
13
|
+
|
|
14
|
+
This API is deprecated:
|
|
15
|
+
|
|
16
|
+
the new chat API doesn't rely on encoders and decoders anymore and uses a dedicated chat API instead
|
|
17
|
+
|
|
18
|
+
{% /callout %}
|
|
19
|
+
|
|
12
20
|
**Signature:**
|
|
13
21
|
|
|
14
22
|
```typescript
|
|
15
|
-
export type MessageEncoder = (message:
|
|
23
|
+
export type MessageEncoder = (message: LegacyChatMessage) => Uint8Array;
|
|
16
24
|
```
|
|
17
25
|
|
|
18
|
-
**References:** [
|
|
26
|
+
**References:** [LegacyChatMessage](./core/legacychatmessage.md)
|
|
19
27
|
|
|
20
28
|
{% partial file="p_usage.md" variables={exampleCount: 0} /%}
|
|
@@ -15,13 +15,12 @@
|
|
|
15
15
|
export interface ReceivedChatMessage extends ChatMessage
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
**Extends:**
|
|
18
|
+
**Extends:** ChatMessage
|
|
19
19
|
|
|
20
20
|
{% partial file="p_usage.md" variables={exampleCount: 0} /%}
|
|
21
21
|
|
|
22
22
|
## Properties
|
|
23
23
|
|
|
24
|
-
| Property
|
|
25
|
-
|
|
|
26
|
-
| [
|
|
27
|
-
| [from?](./core/receivedchatmessage.from.md) | Participant | _(Optional)_ |
|
|
24
|
+
| Property | Type | Description |
|
|
25
|
+
| ------------------------------------------- | ----------- | ------------ |
|
|
26
|
+
| [from?](./core/receivedchatmessage.from.md) | Participant | _(Optional)_ |
|
|
@@ -19,6 +19,14 @@ export declare function setupChat(
|
|
|
19
19
|
messageObservable: import("rxjs").Observable<ReceivedChatMessage[]>;
|
|
20
20
|
isSendingObservable: BehaviorSubject<boolean>;
|
|
21
21
|
send: (message: string) => Promise<ChatMessage>;
|
|
22
|
-
update: (
|
|
22
|
+
update: (
|
|
23
|
+
message: string,
|
|
24
|
+
originalMessageOrId: string | ChatMessage
|
|
25
|
+
) => Promise<{
|
|
26
|
+
readonly message: string;
|
|
27
|
+
readonly editTimestamp: number;
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly timestamp: number;
|
|
30
|
+
}>;
|
|
23
31
|
};
|
|
24
32
|
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"title": "setupChatMessageHandler",
|
|
4
|
+
"linkToSource": "https://github.com/livekit/components-js/blob/main/packages/core/src/observables/dataChannel.ts"
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
9
|
+
|
|
10
|
+
# setupChatMessageHandler
|
|
11
|
+
|
|
12
|
+
**Signature:**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
export declare function setupChatMessageHandler(room: Room): {
|
|
16
|
+
chatObservable: Observable<
|
|
17
|
+
[
|
|
18
|
+
message: ChatMessage,
|
|
19
|
+
participant?: LocalParticipant | import("livekit-client").RemoteParticipant | undefined
|
|
20
|
+
]
|
|
21
|
+
>;
|
|
22
|
+
send: (text: string) => Promise<ChatMessage>;
|
|
23
|
+
edit: (
|
|
24
|
+
text: string,
|
|
25
|
+
originalMsg: ChatMessage
|
|
26
|
+
) => Promise<{
|
|
27
|
+
readonly message: string;
|
|
28
|
+
readonly editTimestamp: number;
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly timestamp: number;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
```
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
{
|
|
3
|
-
"title": "
|
|
3
|
+
"title": "AgentState type",
|
|
4
4
|
"linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/hooks/useVoiceAssistant.ts"
|
|
5
5
|
}
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
9
9
|
|
|
10
|
-
#
|
|
10
|
+
# AgentState type
|
|
11
|
+
|
|
12
|
+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
11
13
|
|
|
12
14
|
**Signature:**
|
|
13
15
|
|
|
14
16
|
```typescript
|
|
15
|
-
export type
|
|
17
|
+
export type AgentState =
|
|
16
18
|
| "disconnected"
|
|
17
19
|
| "connecting"
|
|
18
20
|
| "initializing"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
{ "title": "
|
|
2
|
+
{ "title": "AllowMediaPlaybackProps.label property" }
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# AllowMediaPlaybackProps.label property
|
|
8
8
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
|
|
12
|
+
label?: string;
|
|
13
13
|
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"title": "AllowMediaPlaybackProps interface",
|
|
4
|
+
"linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/components/controls/StartMediaButton.tsx"
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
9
|
+
|
|
10
|
+
# AllowMediaPlaybackProps interface
|
|
11
|
+
|
|
12
|
+
**Signature:**
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
export interface AllowMediaPlaybackProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Extends:** React.ButtonHTMLAttributes<HTMLButtonElement>
|
|
19
|
+
|
|
20
|
+
{% partial file="p_usage.md" variables={exampleCount: 0} /%}
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
| Property | Type | Description |
|
|
25
|
+
| -------------------------------------------------- | ------ | ------------ |
|
|
26
|
+
| [label?](./react/allowmediaplaybackprops.label.md) | string | _(Optional)_ |
|
|
@@ -28,5 +28,5 @@ export interface BarVisualizerProps extends React.HTMLProps<HTMLDivElement>
|
|
|
28
28
|
| [barCount?](./react/barvisualizerprops.barcount.md) | number | **_(BETA)_** _(Optional)_ Number of bars that show up in the visualizer |
|
|
29
29
|
| [children?](./react/barvisualizerprops.children.md) | React.ReactNode | **_(BETA)_** _(Optional)_ The template component to be used in the visualizer. |
|
|
30
30
|
| [options?](./react/barvisualizerprops.options.md) | [BarVisualizerOptions](./react/barvisualizeroptions.md) | **_(BETA)_** _(Optional)_ |
|
|
31
|
-
| [state?](./react/barvisualizerprops.state.md) | [
|
|
31
|
+
| [state?](./react/barvisualizerprops.state.md) | [AgentState](./react/agentstate.md) | **_(BETA)_** _(Optional)_ If set, the visualizer will transition between different voice assistant states |
|
|
32
32
|
| [trackRef?](./react/barvisualizerprops.trackref.md) | [TrackReferenceOrPlaceholder](./react/trackreferenceorplaceholder.md) | **_(BETA)_** _(Optional)_ |
|
|
@@ -21,7 +21,7 @@ import { BarVisualizer } from "@livekit/components-react";
|
|
|
21
21
|
|
|
22
22
|
## Remarks
|
|
23
23
|
|
|
24
|
-
For VoiceAssistant state transitions this component requires a voice assistant agent running with livekit-agents ><!-- -->= 0.
|
|
24
|
+
For VoiceAssistant state transitions this component requires a voice assistant agent running with livekit-agents ><!-- -->= 0.9.0
|
|
25
25
|
|
|
26
26
|
## Usage
|
|
27
27
|
|
|
@@ -47,7 +47,7 @@ _(Optional)_
|
|
|
47
47
|
{% /parameter %}
|
|
48
48
|
|
|
49
49
|
{% parameter name="saveUserChoices" type="boolean" optional=true %}
|
|
50
|
-
_(Optional)_ If `true`<!-- -->, the user's device choices will be persisted. This will
|
|
50
|
+
_(Optional)_ If `true`<!-- -->, the user's device choices will be persisted. This will enable the user to have the same device choices when they rejoin the room.
|
|
51
51
|
|
|
52
52
|
{% /parameter %}
|
|
53
53
|
|
|
@@ -27,7 +27,7 @@ If you want to loop over individual tracks instead of participants, you can use
|
|
|
27
27
|
const participants = useParticipants();
|
|
28
28
|
<ParticipantLoop participants={participants}>
|
|
29
29
|
<ParticipantName />
|
|
30
|
-
|
|
30
|
+
</ParticipantLoop>;
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
@@ -19,7 +19,7 @@ import { PreJoin } from "@livekit/components-react";
|
|
|
19
19
|
|
|
20
20
|
## Remarks
|
|
21
21
|
|
|
22
|
-
This component is independent of the `LiveKitRoom` component and should not be nested within it. Because it only
|
|
22
|
+
This component is independent of the `LiveKitRoom` component and should not be nested within it. Because it only accesses the local media tracks this component is self-contained and works without connection to the LiveKit server.
|
|
23
23
|
|
|
24
24
|
## Usage
|
|
25
25
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"title": "StartMediaButton",
|
|
4
|
+
"linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/components/controls/StartMediaButton.tsx"
|
|
5
|
+
}
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
9
|
+
|
|
10
|
+
# StartMediaButton
|
|
11
|
+
|
|
12
|
+
The `StartMediaButton` component is only visible when the browser blocks media playback. This is due to some browser implemented autoplay policies. To start media playback, the user must perform a user-initiated event such as clicking this button. As soon as media playback starts, the button hides itself again.
|
|
13
|
+
|
|
14
|
+
## Import
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { StartMediaButton } from "@livekit/components-react";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<LiveKitRoom>
|
|
24
|
+
<StartMediaButton label="Click to allow media playback" />
|
|
25
|
+
</LiveKitRoom>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
29
|
+
|
|
30
|
+
## Properties
|
|
31
|
+
|
|
32
|
+
{% parameter name="label" type="string" optional=true %}
|
|
33
|
+
_(Optional)_
|
|
34
|
+
|
|
35
|
+
{% /parameter %}
|
|
@@ -21,11 +21,11 @@ import { TrackLoop } from "@livekit/components-react";
|
|
|
21
21
|
|
|
22
22
|
```tsx
|
|
23
23
|
const trackRefs = useTracks([Track.Source.Camera]);
|
|
24
|
-
<TrackLoop tracks={trackRefs}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
<TrackLoop tracks={trackRefs}>
|
|
25
|
+
<TrackRefContext.Consumer>
|
|
26
|
+
{(trackRef) => trackRef && <VideoTrack trackRef={trackRef} />}
|
|
27
|
+
</TrackRefContext.Consumer>
|
|
28
|
+
</TrackLoop>;
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
@@ -19,7 +19,7 @@ import { VideoConference } from "@livekit/components-react";
|
|
|
19
19
|
|
|
20
20
|
## Remarks
|
|
21
21
|
|
|
22
|
-
The component is implemented with other LiveKit components like `FocusContextProvider`<!-- -->, `GridLayout`<!-- -->, `ControlBar`<!-- -->, `FocusLayoutContainer` and `FocusLayout`<!-- -->. You can use
|
|
22
|
+
The component is implemented with other LiveKit components like `FocusContextProvider`<!-- -->, `GridLayout`<!-- -->, `ControlBar`<!-- -->, `FocusLayoutContainer` and `FocusLayout`<!-- -->. You can use these components as a starting point for your own custom video conferencing application.
|
|
23
23
|
|
|
24
24
|
## Usage
|
|
25
25
|
|
|
@@ -17,7 +17,15 @@
|
|
|
17
17
|
import { VoiceAssistantControlBar } from "@livekit/components-react";
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
<LiveKitRoom ... >
|
|
24
|
+
<VoiceAssistantControlBar />
|
|
25
|
+
</LiveKitRoom>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
21
29
|
|
|
22
30
|
## Properties
|
|
23
31
|
|
|
@@ -35,6 +43,6 @@ import { VoiceAssistantControlBar } from "@livekit/components-react";
|
|
|
35
43
|
{% /parameter %}
|
|
36
44
|
|
|
37
45
|
{% parameter name="saveUserChoices" type="boolean" optional=true %}
|
|
38
|
-
_(Optional)_ If `true`<!-- -->, the user's device choices will be persisted. This will enables the user to have the same device choices when they rejoin the room.
|
|
46
|
+
**_(BETA)_** _(Optional)_ If `true`<!-- -->, the user's device choices will be persisted. This will enables the user to have the same device choices when they rejoin the room.
|
|
39
47
|
|
|
40
48
|
{% /parameter %}
|
|
@@ -21,9 +21,9 @@ export interface ControlBarProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
21
21
|
|
|
22
22
|
## Properties
|
|
23
23
|
|
|
24
|
-
| Property | Type | Description
|
|
25
|
-
| -------------------------------------------------------------- | ----------------------------------------------------------- |
|
|
26
|
-
| [controls?](./react/controlbarprops.controls.md) | [ControlBarControls](./react/controlbarcontrols.md) | _(Optional)_
|
|
27
|
-
| [onDeviceError?](./react/controlbarprops.ondeviceerror.md) | (error: { source: Track.Source; error: Error; }) => void | _(Optional)_
|
|
28
|
-
| [saveUserChoices?](./react/controlbarprops.saveuserchoices.md) | boolean | _(Optional)_ If <code>true</code>, the user's device choices will be persisted. This will
|
|
29
|
-
| [variation?](./react/controlbarprops.variation.md) | 'minimal' \| 'verbose' \| 'textOnly' | _(Optional)_
|
|
24
|
+
| Property | Type | Description |
|
|
25
|
+
| -------------------------------------------------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
26
|
+
| [controls?](./react/controlbarprops.controls.md) | [ControlBarControls](./react/controlbarcontrols.md) | _(Optional)_ |
|
|
27
|
+
| [onDeviceError?](./react/controlbarprops.ondeviceerror.md) | (error: { source: Track.Source; error: Error; }) => void | _(Optional)_ |
|
|
28
|
+
| [saveUserChoices?](./react/controlbarprops.saveuserchoices.md) | boolean | _(Optional)_ If <code>true</code>, the user's device choices will be persisted. This will enable the user to have the same device choices when they rejoin the room. |
|
|
29
|
+
| [variation?](./react/controlbarprops.variation.md) | 'minimal' \| 'verbose' \| 'textOnly' | _(Optional)_ |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# ControlBarProps.saveUserChoices property
|
|
8
8
|
|
|
9
|
-
If `true`<!-- -->, the user's device choices will be persisted. This will
|
|
9
|
+
If `true`<!-- -->, the user's device choices will be persisted. This will enable the user to have the same device choices when they rejoin the room.
|
|
10
10
|
|
|
11
11
|
**Signature:**
|
|
12
12
|
|
|
@@ -17,10 +17,6 @@ The `useChat` hook provides chat functionality for a LiveKit room. It returns a
|
|
|
17
17
|
import { useChat } from "@livekit/components-react";
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
## Remarks
|
|
21
|
-
|
|
22
|
-
It is possible to pass configurations for custom message encoding and decoding and non-default topics on which to send the messages.
|
|
23
|
-
|
|
24
20
|
{% partial file="p_usage.md" variables={exampleCount: 0} /%}
|
|
25
21
|
|
|
26
22
|
## Properties
|
|
@@ -32,8 +28,13 @@ It is possible to pass configurations for custom message encoding and decoding a
|
|
|
32
28
|
|
|
33
29
|
```typescript
|
|
34
30
|
{
|
|
35
|
-
send: (message: string) => Promise<import("
|
|
36
|
-
update: (message: string,
|
|
31
|
+
send: (message: string) => Promise<import("livekit-client").ChatMessage>;
|
|
32
|
+
update: (message: string, originalMessageOrId: string | import("livekit-client").ChatMessage) => Promise<{
|
|
33
|
+
readonly message: string;
|
|
34
|
+
readonly editTimestamp: number;
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly timestamp: number;
|
|
37
|
+
}>;
|
|
37
38
|
chatMessages: ReceivedChatMessage[];
|
|
38
39
|
isSending: boolean;
|
|
39
40
|
}
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
# useVoiceAssistant
|
|
11
11
|
|
|
12
|
-
This
|
|
12
|
+
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
13
|
+
|
|
14
|
+
This hook looks for the first agent-participant in the room.
|
|
13
15
|
|
|
14
16
|
## Import
|
|
15
17
|
|
|
@@ -19,9 +21,15 @@ import { useVoiceAssistant } from "@livekit/components-react";
|
|
|
19
21
|
|
|
20
22
|
## Remarks
|
|
21
23
|
|
|
22
|
-
This hook requires
|
|
24
|
+
This hook requires an agent running with livekit-agents ><!-- -->= 0.9.0
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
const { state, audioTrack, agentTranscriptions, agentAttributes } = useVoiceAssistant();
|
|
30
|
+
```
|
|
23
31
|
|
|
24
|
-
{% partial file="p_usage.md" variables={exampleCount:
|
|
32
|
+
{% partial file="p_usage.md" variables={exampleCount: 1} /%}
|
|
25
33
|
|
|
26
34
|
## Returns
|
|
27
35
|
|