Skip to content

Commit baa4e78

Browse files
authored
Default to dual peer connection for custom tab (#496)
1 parent dc82cc2 commit baa4e78

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

app/custom/VideoConferenceClientImpl.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export function VideoConferenceClientImpl(props: {
2121
liveKitUrl: string;
2222
token: string;
2323
codec: VideoCodec | undefined;
24+
singlePeerConnection: boolean | undefined;
2425
}) {
2526
const keyProvider = new ExternalE2EEKeyProvider();
2627
const { worker, e2eePassphrase } = useSetupE2EE();
@@ -43,7 +44,7 @@ export function VideoConferenceClientImpl(props: {
4344
worker,
4445
}
4546
: undefined,
46-
singlePeerConnection: true,
47+
singlePeerConnection: props.singlePeerConnection,
4748
};
4849
}, [e2eeEnabled, props.codec, keyProvider, worker]);
4950

app/custom/page.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ export default async function CustomRoomConnection(props: {
77
liveKitUrl?: string;
88
token?: string;
99
codec?: string;
10+
singlePC?: string;
1011
}>;
1112
}) {
12-
const { liveKitUrl, token, codec } = await props.searchParams;
13+
const { liveKitUrl, token, codec, singlePC } = await props.searchParams;
1314
if (typeof liveKitUrl !== 'string') {
1415
return <h2>Missing LiveKit URL</h2>;
1516
}
@@ -22,7 +23,12 @@ export default async function CustomRoomConnection(props: {
2223

2324
return (
2425
<main data-lk-theme="default" style={{ height: '100%' }}>
25-
<VideoConferenceClientImpl liveKitUrl={liveKitUrl} token={token} codec={codec} />
26+
<VideoConferenceClientImpl
27+
liveKitUrl={liveKitUrl}
28+
token={token}
29+
codec={codec}
30+
singlePeerConnection={singlePC === 'true'}
31+
/>
2632
</main>
2733
);
2834
}

0 commit comments

Comments
 (0)