UNPKG

@100mslive/hms-video-store

Version:

@100mslive Core SDK which abstracts the complexities of webRTC while providing a reactive store for data management with a unidirectional data flow

60 lines (59 loc) 2.59 kB
import { Store } from './store'; import { AnalyticsTimer } from '../analytics/AnalyticsTimer'; import { DeviceManager } from '../device-manager'; import { EventBus } from '../events/EventBus'; import { HMSScreenShareConfig, ScreenCaptureHandleConfig } from '../interfaces'; import InitialSettings from '../interfaces/settings'; import { HMSLocalTrack, HMSLocalVideoTrack } from '../internal'; import { HMSTrackSettings } from '../media/settings'; import { HMSLocalStream } from '../media/streams/HMSLocalStream'; import { HMSTrackExceptionTrackType } from '../media/tracks/HMSTrackExceptionTrackType'; import ITransportObserver from '../transport/ITransportObserver'; declare type IFetchTrackOptions = boolean | 'empty'; interface IFetchAVTrackOptions { audio: IFetchTrackOptions; video: IFetchTrackOptions; } export declare class LocalTrackManager { private store; private observer; private deviceManager; private eventBus; private analyticsTimer; readonly TAG: string; private captureHandleIdentifier?; constructor(store: Store, observer: ITransportObserver, deviceManager: DeviceManager, eventBus: EventBus, analyticsTimer: AnalyticsTimer); getTracksToPublish(initialSettings?: InitialSettings): Promise<HMSLocalTrack[]>; /** * @throws {HMSException} */ getLocalTracks(fetchTrackOptions: IFetchAVTrackOptions | undefined, settings: HMSTrackSettings, localStream?: HMSLocalStream): Promise<Array<HMSLocalTrack>>; /** * @throws {HMSException} */ private getNativeLocalTracks; private optimizeScreenShareConstraint; getLocalScreen(partialConfig?: HMSScreenShareConfig, optimise?: boolean): Promise<HMSLocalTrack[]>; setScreenCaptureHandleConfig(config?: Partial<ScreenCaptureHandleConfig>): void; validateCurrentTabCapture(track: HMSLocalVideoTrack, forceCurrentTab: boolean): boolean; requestPermissions(): Promise<void>; static getEmptyVideoTrack(prevTrack?: MediaStreamTrack): MediaStreamTrack; static getEmptyAudioTrack(): MediaStreamTrack; static cleanup(): void; /** * @throws {HMSException} */ private getAVTracks; private getAVTrackSettings; private isInIframe; private retryGetLocalTracks; getErrorType(videoError: boolean, audioError: boolean): HMSTrackExceptionTrackType; private getEmptyTracks; private updateCurrentLocalTrackSettings; private getAudioSettings; private getVideoSettings; private getScreenshareSettings; private getOrDefaultScreenshareConfig; private createHMSLocalTracks; } export {};