Skip to content

feat: add onDeviceError callback to VideoConference component. #1186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clean-pants-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@livekit/components-react": patch
---

feat: add onDeviceError callback to VideoConference component.
7 changes: 6 additions & 1 deletion packages/react/src/prefabs/VideoConference.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface VideoConferenceProps extends React.HTMLAttributes<HTMLDivElemen
chatMessageDecoder?: MessageDecoder;
/** @alpha */
SettingsComponent?: React.ComponentType;
onDeviceError?: (error: { source: Track.Source; error: Error }) => void;
}

/**
Expand All @@ -58,6 +59,7 @@ export function VideoConference({
chatMessageDecoder,
chatMessageEncoder,
SettingsComponent,
onDeviceError,
...props
}: VideoConferenceProps) {
const [widgetState, setWidgetState] = React.useState<WidgetState>({
Expand Down Expand Up @@ -155,7 +157,10 @@ export function VideoConference({
</FocusLayoutContainer>
</div>
)}
<ControlBar controls={{ chat: true, settings: !!SettingsComponent }} />
<ControlBar
onDeviceError={onDeviceError}
controls={{ chat: true, settings: !!SettingsComponent }}
/>
</div>
<Chat
style={{ display: widgetState.showChat ? 'grid' : 'none' }}
Expand Down
Loading