meet/app/custom/page.tsx
renovate[bot] 17ff1d6092
fix(deps): update nextjs monorepo to v15 (major) (#406)
* fix(deps): update nextjs monorepo to v15

* fix code for v15 upgrade

* fix param await

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: lukasIO <mail@lukasseiler.de>
2025-04-08 08:09:47 +02:00

29 lines
884 B
TypeScript

import { videoCodecs } from 'livekit-client';
import { VideoConferenceClientImpl } from './VideoConferenceClientImpl';
import { isVideoCodec } from '@/lib/types';
export default async function CustomRoomConnection(props: {
searchParams: Promise<{
liveKitUrl?: string;
token?: string;
codec?: string;
}>;
}) {
const { liveKitUrl, token, codec } = await props.searchParams;
if (typeof liveKitUrl !== 'string') {
return <h2>Missing LiveKit URL</h2>;
}
if (typeof token !== 'string') {
return <h2>Missing LiveKit token</h2>;
}
if (codec !== undefined && !isVideoCodec(codec)) {
return <h2>Invalid codec, if defined it has to be [{videoCodecs.join(', ')}].</h2>;
}
return (
<main data-lk-theme="default" style={{ height: '100%' }}>
<VideoConferenceClientImpl liveKitUrl={liveKitUrl} token={token} codec={codec} />
</main>
);
}