import type { Translations } from '@nomercy-entertainment/nomercy-player-core'; import type { NMVideoPlayer } from '../../index.js'; import { Plugin } from '@nomercy-entertainment/nomercy-player-core'; /** Options for {@link TwitchPlugin}. */ export interface TwitchPluginOptions { /** Client id sent to Twitch's web API when resolving a clip. */ clientId?: string; /** Address of a live playlist proxy that you run yourself. When set, live plays in this player; without it, live uses Twitch's embed. No video passes through it. */ proxyUrl?: string; } /** Events emitted by {@link TwitchPlugin}. */ export interface TwitchPluginEvents { /** A clip link was resolved to its playable file. */ 'clip:resolved': { slug: string; title: string; duration: number; }; /** A live link pointed at a channel that is not streaming. */ 'channel:offline': { channel: string; }; /** A live stream that was playing has ended. */ 'channel:ended': { channel: string; }; } /** Lets the video player play regular Twitch links: clips, VODs and live channels. */ export declare class TwitchPlugin extends Plugin { static readonly id: string; static readonly version: string; static readonly description: string; static readonly translations: Translations; /** Twitch is not the media server, so the player's bearer token must not go with these requests. */ private readonly postWithoutAuth; private muted; private sliderLevel; private itemIndex; private rawChannel; private choosingLevel; private twitchPlayerChosen; /** Whether live channels play in Twitch's own player instead of this one. */ usesTwitchPlayer(): boolean; /** Lets the viewer pick Twitch's own player or this one for live channels. A playing channel restarts in the new one. */ useTwitchPlayer(chosen: boolean): void; /** Installs the backend, claims clip links, and picks the right backend before every load. */ use(): void; /** Twitch locks VOD video to its own site, so only live can play in this player without proxying video. */ private playsRaw; /** Turns a channel link into its HLS address, so the player's own engine and UI do everything. */ private installStreamResolver; private findStream; /** Never let the adaptive engine start blurry. The viewer's own menu choice comes after this and is left alone. */ private holdTallestLevel; private announceRawStreamEnd; /** Adds the `twitch` backend and keeps any factory the consumer already configured. */ private installBackendFactory; /** A new backend starts at full volume, so it gets the slider level, which survives a mute. */ private swapBackend; /** A Twitch link is not a file, so prefetching the next item would only fail. */ private skipPreloadOfTwitchItems; /** A link alone tells a viewer nothing, so the real name is looked up. Playback never waits on a failure. */ private fillTitle; /** Tells the viewer and listeners, so a gone channel never leaves a silent black screen. */ private announceChannelGone; /** Finds the clip's file and announces it. */ private resolveClipFile; }