completed Audio frontend

This commit is contained in:
PxlLoewe
2025-03-17 00:41:07 -07:00
parent e722adaf8e
commit 9a7049ec44
28 changed files with 252 additions and 889 deletions

View File

@@ -5,12 +5,12 @@ if (!process.env.LIVEKIT_API_KEY) throw new Error("LIVEKIT_API_KEY not set");
if (!process.env.LIVEKIT_API_SECRET)
throw new Error("LIVEKIT_API_SECRET not set");
const createToken = async () => {
const createToken = async (roomName: string) => {
// If this room doesn't exist, it'll be automatically created when the first
// participant joins
const roomName = "quickstart-room";
// Identifier to be used for participant.
// It's available as LocalParticipant.identity with livekit-client SDK
// TODO: Move function to dispatch nextjs app as API route to use authentication of nextAuth
const participantName =
"quickstart-username" + Math.random().toString(36).substring(7);
@@ -31,8 +31,10 @@ const createToken = async () => {
const router = Router();
router.get("/token", async (req, res) => {
const roomName = req.query.roomName as string;
console.log("roomName", roomName);
res.send({
token: await createToken(),
token: await createToken(roomName),
});
});