Init
This commit is contained in:
16
src/lib/types.ts
Normal file
16
src/lib/types.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { LocalAudioTrack, LocalVideoTrack } from "livekit-client";
|
||||
|
||||
export interface SessionProps {
|
||||
roomName: string;
|
||||
identity: string;
|
||||
audioTrack?: LocalAudioTrack;
|
||||
videoTrack?: LocalVideoTrack;
|
||||
region?: string;
|
||||
turnServer?: RTCIceServer;
|
||||
forceRelay?: boolean;
|
||||
}
|
||||
|
||||
export interface TokenResult {
|
||||
identity: string;
|
||||
accessToken: string;
|
||||
}
|
||||
12
src/lib/util.ts
Normal file
12
src/lib/util.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export function generateRandomAlphanumeric(length: number): string {
|
||||
const characters =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
let result = "";
|
||||
const charactersLength = characters.length;
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user