Skip to content

Commit b6ac84d

Browse files
authored
feat: add MediaDeviceKind to media device error event (#1143)
1 parent a17c882 commit b6ac84d

File tree

8 files changed

+42
-26
lines changed

8 files changed

+42
-26
lines changed

.changeset/quick-donkeys-turn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@livekit/components-react": patch
3+
---
4+
5+
feat: add MediaDeviceKind to onMediaDeviceFailure callback

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ build/
66
yarn-error.log
77
.DS_Store
88
generated/
9-
.husky/
9+
.husky/
10+
.env
11+
.env.*
12+
.next/
13+
next-env.d.ts

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
},
4646
"devDependencies": {
4747
"@livekit/components-styles": "workspace:*",
48-
"@livekit/protocol": "^1.36.1",
48+
"@livekit/protocol": "^1.38.0",
4949
"@microsoft/api-extractor": "^7.36.0",
5050
"@size-limit/file": "^11.0.2",
5151
"@size-limit/webpack": "^11.0.2",

packages/react/etc/components-react.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ export interface LiveKitRoomProps extends Omit<React_2.HTMLAttributes<HTMLDivEle
407407
// (undocumented)
408408
onError?: (error: Error) => void;
409409
// (undocumented)
410-
onMediaDeviceFailure?: (failure?: MediaDeviceFailure) => void;
410+
onMediaDeviceFailure?: (failure?: MediaDeviceFailure, kind?: MediaDeviceKind) => void;
411411
options?: RoomOptions;
412412
room?: Room;
413413
screen?: ScreenShareCaptureOptions | boolean;

packages/react/src/components/LiveKitRoom.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export interface LiveKitRoomProps extends Omit<React.HTMLAttributes<HTMLDivEleme
6767
onConnected?: () => void;
6868
onDisconnected?: (reason?: DisconnectReason) => void;
6969
onError?: (error: Error) => void;
70-
onMediaDeviceFailure?: (failure?: MediaDeviceFailure) => void;
70+
onMediaDeviceFailure?: (failure?: MediaDeviceFailure, kind?: MediaDeviceKind) => void;
7171
onEncryptionError?: (error: Error) => void;
7272
/**
7373
* Optional room instance.

packages/react/src/hooks/useLiveKitRoom.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ export function useLiveKitRoom<T extends HTMLElement>(
8484
});
8585
};
8686

87-
const handleMediaDeviceError = (e: Error) => {
87+
const handleMediaDeviceError = (e: Error, kind: MediaDeviceKind) => {
8888
const mediaDeviceFailure = MediaDeviceFailure.getFailure(e);
89-
onMediaDeviceFailure?.(mediaDeviceFailure);
89+
onMediaDeviceFailure?.(mediaDeviceFailure, kind);
9090
};
9191
const handleEncryptionError = (e: Error) => {
9292
onEncryptionError?.(e);

pnpm-lock.yaml

Lines changed: 26 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ packages:
55
- 'tooling/*'
66

77
catalog:
8-
livekit-client: ^2.11.1
8+
livekit-client: ^2.13.1

0 commit comments

Comments
 (0)