iscream-webrtc-sdk
Version:
I-scream WebRTC SDK for browser - LiveKit based real-time communication with teacher/student roles
101 lines (100 loc) • 2.34 kB
TypeScript
export interface IScreamConfig {
serverHost?: string;
tokenEndpoint?: string;
livekitEndpoint?: string;
useHttps?: boolean;
debug?: boolean;
auth: {
clientId: string;
clientSecret: string;
};
}
export interface ConnectOptions {
roomName: string;
participantName: string;
role: 'teacher' | 'student';
token?: string;
publishOnJoin?: boolean;
adaptiveStream?: boolean;
dynacast?: boolean;
}
export interface ParticipantInfo {
identity: string;
name: string;
role: 'teacher' | 'student';
isLocal: boolean;
isPresenter: boolean;
mediaState: {
cameraEnabled: boolean;
microphoneEnabled: boolean;
screenShareEnabled: boolean;
};
}
export interface VideoQualityPreset {
width: number;
height: number;
frameRate: number;
bitrate: number;
}
export interface AudioQualityPreset {
sampleRate: number;
bitrate: number;
}
export interface RoomStatus {
participants: Array<{
identity: string;
name: string;
role: string;
metadata?: any;
}>;
}
export interface TokenResponse {
token: string;
serverUrl?: string;
}
export interface AuthResponse {
access_token: string;
expires_in: number;
client_name: string;
}
export interface DataMessage {
type: string;
content?: string;
presenterIdentity?: string;
previousPresenter?: string;
timestamp: number;
reason?: string;
sender?: string;
}
export interface MediaState {
camera: boolean;
microphone: boolean;
screenShare: boolean;
canPublish: boolean;
}
export interface ConnectionInfo {
isConnected: boolean;
roomName: string | null;
participantName: string | null;
role: 'teacher' | 'student' | null;
participantCount: number;
canPublish: boolean;
}
export interface DebugInfo {
connection: ConnectionInfo;
media: MediaState;
participants: {
total: number;
teachers: number;
students: number;
presenter: string | null;
};
quality: {
video: string;
adaptive: boolean;
};
}
export declare const VIDEO_QUALITY_PRESETS: Record<string, VideoQualityPreset | {
adaptive: boolean;
}>;
export declare const AUDIO_QUALITY_PRESETS: Record<string, AudioQualityPreset>;