UNPKG

iscream-webrtc-sdk

Version:

I-scream WebRTC SDK for browser - LiveKit based real-time communication with teacher/student roles

44 lines (43 loc) 1.67 kB
import type { Room } from 'livekit-client'; import type { ParticipantInfo } from './types'; export declare class MediaController { private room; private userRole; private canPublishMedia; private isScreenSharing; private currentVideoQuality; private currentAudioQuality; private selectedAudioInputId; private selectedAudioOutputId; private debug; constructor(debug?: boolean); setRoom(room: Room, userRole: 'teacher' | 'student', canPublishMedia: boolean): void; updatePublishPermission(canPublish: boolean): void; canPublishMediaStream(): boolean; toggleCamera(): Promise<boolean>; toggleMicrophone(): Promise<boolean>; enableVideo(enabled: boolean): Promise<boolean>; enableAudio(enabled: boolean): Promise<boolean>; startScreenShare(): Promise<boolean>; stopScreenShare(): Promise<void>; setVideoQuality(quality: string, isPresenter: boolean, forceApply?: boolean): Promise<void>; setAudioQuality(quality: string, isPresenter: boolean): Promise<void>; switchAudioInput(deviceId: string): Promise<void>; switchAudioOutput(deviceId: string): Promise<void>; getMediaDevices(): Promise<MediaDeviceInfo[]>; getMediaState(localParticipant: ParticipantInfo | null): { camera: boolean; microphone: boolean; screenShare: boolean; canPublish: boolean; }; setMediaState(state: { camera?: boolean; microphone?: boolean; screenShare?: boolean; }): Promise<any>; getCurrentVideoQuality(): string; getCurrentAudioQuality(): string; getIsScreenSharing(): boolean; isScreenShareActive(): boolean; }