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

42 lines (41 loc) 1.32 kB
import { DeviceManager } from '../device-manager'; import { EventBus } from '../events/EventBus'; import { HMSUpdateListener } from '../interfaces'; import { Store } from '../sdk/store'; export declare class AudioSinkManager { private store; private deviceManager; private eventBus; private audioSink?; private autoPausedTracks; private readonly TAG; private volume; private state; private listener?; constructor(store: Store, deviceManager: DeviceManager, eventBus: EventBus); setListener(listener?: HMSUpdateListener): void; private get outputDevice(); getVolume(): number; setVolume(value: number): Promise<void>; /** * This function is to be called only on user interaction when * autoplay error is received. */ unblockAutoplay(): Promise<void>; init(elementId?: string): void; cleanup(): void; private handleAudioPaused; private handleTrackUpdate; private handleTrackAdd; private handleAutoplayError; private handleAudioDeviceChange; /** * try to play audio for the passed in track, assume autoplay error happened if play fails * @param track * @private */ private playAudioFor; private handleTrackRemove; private unpauseAudioTracks; private removeAudioElement; }