@werk1/w1-system-videoblock
Version:
Universal video player supporting YouTube, Vimeo, HLS, DASH with coordination and GSAP integration for W1 System
40 lines (39 loc) • 1.14 kB
TypeScript
/**
* HLS Platform Integration
* Handles HLS.js library loading and HLS stream management
*/
export interface HLSPlayer {
loadSource(src: string): void;
attachMedia(video: HTMLVideoElement): void;
destroy(): void;
on(event: string, callback: (event: string, data: any) => void): void;
off(event: string, callback?: (event: string, data: any) => void): void;
recoverMediaError(): void;
swapAudioCodec(): void;
startLoad(): void;
levels: any[];
currentLevel: number;
}
declare global {
interface Window {
Hls?: {
new (): HLSPlayer;
isSupported(): boolean;
Events: Record<string, string>;
ErrorTypes: Record<string, string>;
ErrorDetails: Record<string, string>;
};
}
}
/**
* Checks if HLS is natively supported by the browser
*/
export declare function isHLSNativelySupported(): boolean;
/**
* Loads the HLS.js library
*/
export declare function loadHLSLibrary(): Promise<boolean>;
/**
* Sets up HLS playback
*/
export declare function setupHLSPlayback(video: HTMLVideoElement, src: string): HLSPlayer | null;