broad-beard-35345
05/13/2025, 9:51 AMtall-airline-16756
05/13/2025, 9:51 AMtall-airline-16756
05/13/2025, 9:52 AM<VideoConference />
component, you can utilize the useChat
hook provided by LiveKit. This hook gives access to message objects that include sender information in the from
property. Here's an example:
import { useChat } from '@livekit/components-react';
export default function Chat() {
const { messages, send, isSending } = useChat();
// messages contain sender information in the 'from' property
}
If you're using the pre-built <chatentry />
component, it displays the sender's name by default. You can control this behavior with the hideName
property:
<chat>
<chatentry hidename="{false}" />
</chat>
Setting hideName
to false
(default) ensures that the sender's name is displayed. This is particularly useful for showing the identity of the message sender. Let me know if you need further assistance!
Sources: Add chat to your React app | LiveKit Docs | ChatEntry | React Components | LiveKit Docsbroad-beard-35345
05/13/2025, 9:54 AMtall-airline-16756
05/13/2025, 9:54 AMGridLayout
, CarouselLayout
, or FocusLayout
to arrange video and audio tracks.
• Participant Components: Render participant media using components such as VideoTrack
, AudioTrack
, ParticipantTile
, ParticipantName
, ConnectionQualityIndicator
, and TrackMutedIndicator
.
• Control Components: Manage media with components like DisconnectButton
, TrackToggle
, MediaDeviceSelect
, StartAudio
, ClearPinButton
, and FocusToggle
.
• Hooks: For more control, you can use hooks such as useTracks
, useParticipants
, and useConnectionState
.
These components and hooks allow you to build a fully customized video interface while maintaining flexibility in design and functionality. Let me know if you need further guidance!
Sources: LiveKit Docs | LiveKit Docs | Building blocks | LiveKit Docsbroad-beard-35345
05/13/2025, 9:55 AMtall-airline-16756
05/13/2025, 9:55 AMimport React from 'react';
import {
VideoTrack,
ParticipantTile,
GridLayout,
useParticipants
} from '@livekit/components-react';
export default function CustomVideoScreen() {
const { participants } = useParticipants();
return (
);
}
This example uses the GridLayout
component to arrange participant video tiles. Each tile includes a VideoTrack
component to display the participant's video. You can further customize the layout and styling as needed.
Let me know if you need help with specific customizations or additional features!broad-beard-35345
05/13/2025, 10:04 AMtall-airline-16756
05/13/2025, 10:04 AMchatMessageFormatter
is an optional property that you can pass to the <VideoConference />
component to customize the formatting of chat messages. Here's an example of how to use it:
const customFormatter = (message) => {
// Customize the message format here
return `${message.from}: ${message.text}`;
};
<VideoConference chatMessageFormatter={customFormatter} />
In this example, the customFormatter
function takes a message object as input and returns a formatted string. You can modify the function to include additional details or apply specific formatting as needed.
Let me know if you need further assistance with implementing this!
Sources: VideoConference | React Components | LiveKit Docsbroad-beard-35345
05/13/2025, 10:07 AMtall-airline-16756
05/13/2025, 10:07 AMchatMessageFormatter
in the <VideoConference />
component currently receives only a single message string as input, rather than a full message object with properties like from
or text
. This means that the formatter function can only modify the string itself, not add additional details like the sender's identity.
If you need to include more information in the formatted message, you may need to customize the chat functionality further or use a different approach to access the full message object. Let me know if you'd like guidance on alternative solutions!
Sources: Chat | React Components | LiveKit Docs | VideoConference | React Components | LiveKit Docs | ChatEntry | React Components | LiveKit Docs