@jellyfish-dev/react-client-sdk
Version:
React client library for Jellyfish.
55 lines • 1.99 kB
TypeScript
import TypedEmitter from "typed-emitter";
import { DeviceError, DevicesStatus } from "./types";
export type TrackType = "audio" | "video" | "audiovideo";
export type MediaDeviceType = "displayMedia" | "userMedia";
export type DisplayMediaManagerEvents = {
deviceReady: (event: {
type: TrackType;
}, state: ScreenShareDeviceState) => void;
deviceStopped: (event: {
type: TrackType;
}, state: ScreenShareDeviceState) => void;
deviceEnabled: (event: {
type: TrackType;
}, state: ScreenShareDeviceState) => void;
deviceDisabled: (event: {
type: TrackType;
}, state: ScreenShareDeviceState) => void;
error: (event: {
type: TrackType;
error: DeviceError | null;
rawError: any;
}, state: ScreenShareDeviceState) => void;
};
export interface ScreenShareManagerConfig {
audioTrackConstraints?: boolean | MediaTrackConstraints;
videoTrackConstraints?: boolean | MediaTrackConstraints;
}
export type ScreenShareMedia = {
stream: MediaStream | null;
track: MediaStreamTrack | null;
enabled: boolean;
};
export type ScreenShareDeviceState = {
status: DevicesStatus;
audioMedia: ScreenShareMedia | null;
videoMedia: ScreenShareMedia | null;
error: DeviceError | null;
};
declare const ScreenShareManager_base: new () => TypedEmitter<DisplayMediaManagerEvents>;
export declare class ScreenShareManager extends ScreenShareManager_base {
private readonly defaultConfig?;
private config?;
private data;
getSnapshot(): ScreenShareDeviceState;
constructor(defaultConfig?: ScreenShareManagerConfig);
setConfig(config: ScreenShareManagerConfig): void;
private getType;
start(config?: ScreenShareManagerConfig): Promise<void>;
private setupOnEndedCallback;
private onTrackEnded;
stop(type: TrackType): Promise<void>;
setEnable(type: TrackType, value: boolean): void;
}
export {};
//# sourceMappingURL=ScreenShareManager.d.ts.map