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

31 lines (30 loc) 1.06 kB
import { HMSLocalVideoTrack, HMSRemoteVideoTrack } from '../../internal'; /** * This class is to manager video elements for video tracks. * This will handle attaching/detaching when element is in view or out of view. * This will also handle selecting appropriate layer when element size changesx */ export declare class VideoElementManager { private track; private readonly TAG; private resizeObserver?; private intersectionObserver?; private videoElements; private entries; private id; constructor(track: HMSLocalVideoTrack | HMSRemoteVideoTrack); updateSinks(requestLayer?: boolean): void; addVideoElement(videoElement: HTMLVideoElement): Promise<void>; removeVideoElement(videoElement: HTMLVideoElement): void; getVideoElements(): HTMLVideoElement[]; private init; private handleIntersection; private handleResize; /** * Taken from * https://stackoverflow.com/a/125106/4321808 */ private isElementInViewport; private selectMaxLayer; cleanup: () => void; }