//#region src/dom/twitch/player-api.d.ts /** Namespace on the commands the host posts, and on the state snapshots that come back. */ declare const PLAYER_PROXY_NAMESPACE = "twitch-embed-player-proxy"; /** Namespace on the lifecycle events the embed emits. */ declare const EMBED_NAMESPACE = "twitch-embed"; declare const PLAYBACK_IDLE = "Idle"; declare const PLAYBACK_READY = "Ready"; declare const PLAYBACK_BUFFERING = "Buffering"; declare const PLAYBACK_PLAYING = "Playing"; declare const PLAYBACK_ENDED = "Ended"; /** Where the embed is in its playback lifecycle. */ type TwitchPlaybackState = typeof PLAYBACK_IDLE | typeof PLAYBACK_READY | typeof PLAYBACK_BUFFERING | typeof PLAYBACK_PLAYING | typeof PLAYBACK_ENDED; /** Delivery statistics the embed reports alongside its player state. */ interface TwitchVideoStats extends Record { /** Seconds of media buffered ahead of the playhead. */ bufferSize?: number; } /** Player state snapshot. The embed sends only what changed, so a snapshot reads as a patch, not a whole state. */ interface TwitchPlayerState { /** Length of the VOD in seconds. Live channels report no meaningful duration. */ duration?: number; currentTime?: number; /** Volume in the `0`–`1` range, matching `HTMLMediaElement`. */ volume?: number; muted?: boolean; playback?: TwitchPlaybackState; stats?: { videoStats?: TwitchVideoStats; }; } /** Lifecycle event the embed emits (`ready`, `play`, `pause`, `seek`, `ended`, `offline`, …). */ interface TwitchEmbedMessage { namespace: typeof EMBED_NAMESPACE; eventName: string; params?: unknown; } /** Player state snapshot, pushed on the same namespace the host sends commands on. */ interface TwitchPlayerProxyMessage { namespace: typeof PLAYER_PROXY_NAMESPACE; eventName: string; params?: TwitchPlayerState; } /** Anything the embed posts back to the host. */ type TwitchInboundMessage = TwitchEmbedMessage | TwitchPlayerProxyMessage; /** Command the host posts to the embed. Its `eventName` is one of the numeric codes above. */ interface TwitchCommandMessage { namespace: typeof PLAYER_PROXY_NAMESPACE; eventName: number; params?: unknown; } //#endregion export { TwitchCommandMessage, TwitchEmbedMessage, TwitchInboundMessage, TwitchPlaybackState, TwitchPlayerProxyMessage, TwitchPlayerState, TwitchVideoStats }; //# sourceMappingURL=player-api.d.ts.map