/** * TV key-handler plugin — keyboard-binding layer for TV remote controls. * * Subclasses the video-v2 KeyHandlerPlugin to inherit the full default binding * set (Color F0-F3, BrowserFavorites, all universal media keys, modifier seeks, * chapter nav, speed, frame-advance, subs/audio/aspect-ratio, fullscreen, stop) * and overrides the groups that behave differently on a TV: * * - Arrow keys: on desktop they are gated behind `!isTv()`. Here they seek * directly because the host page is expected to remove focus from interactive * elements before mounting this plugin (TV UX convention). * * - Volume arrows: desktop-ui disables them on TV; this plugin enables them so * a web-based TV shell that owns volume can forward events correctly. * * - Info key: wired to an OSD overlay showing title / chapter / time instead of * the commented-out stub in the base handler. * * - MediaRecord: emits `plugin:tv-key-handler:bookmark` with the current time so * the consumer can decide what to persist; the player itself does not store * bookmarks. * * - Help key: emits `plugin:tv-key-handler:shortcuts-toggle` (not * `plugin:desktop-ui:…`) so a TV shortcuts overlay can be registered * independently. * * NoMercy Connect routing * ─────────────────────── * All bindings call local player methods directly. A consumer-side NoMercy * Connect plugin can call `keyHandler.replace(combo, fn)` to route commands * through the socket instead. */ import type { Translations } from '@nomercy-entertainment/nomercy-player-core'; import type { VideoPlaylistItem } from '../../types.js'; import { KeyHandlerPlugin } from '../key-handler/index.js'; export interface TvKeyHandlerOptions { /** * Seconds to seek when ArrowLeft / ArrowRight are pressed on TV. Default 5. * (Color-button seeks are fixed at 30/60/90/120 s — not affected by this.) */ arrowSeekSeconds?: number; /** * Milliseconds to display the Info OSD before it auto-dismisses. Default 5000. */ infoDisplayMs?: number; } export declare class TvKeyHandlerPlugin extends KeyHandlerPlugin { static readonly id: string; static readonly version: string; static readonly description: string; static readonly translations: Translations; private get tvOpts(); /** * Extends the base default groups with TV-specific bindings. * All Color-button, BrowserFavorites, universal media-key, modifier-seek, * chapter, speed, frame-advance, subtitle-size, and stop bindings are * inherited from super.addDefaults(). */ protected addDefaults(): void; /** * On TV, Arrow keys seek directly — they are NOT used for focus navigation * inside the player element while the player is active. */ protected addNavigationKeys(): void; /** * On TV, volume arrows are enabled — the web-based TV shell routes these to * the system mixer or handles them within the player as appropriate. */ protected addVolumeKeys(): void; /** * Aspect-ratio cycle via BrowserFavorites and 'a' — shows an OSD message * confirming the change on TV where there is no visible control bar. */ protected addAspectRatioKeys(): void; /** * Info key — shows a brief OSD with title, chapter, current time and * time remaining. Also emits `plugin:tv-key-handler:info` so a TV shell can * render its own overlay. The OSD message fires unconditionally as a fallback. */ protected addInfoKey(): void; /** * MediaRecord — emits `plugin:tv-key-handler:bookmark` with the current time * so the consumer can persist the bookmark. No-ops silently when no listener * is registered. */ protected addMediaRecordKey(): void; /** * Help key — emits `plugin:tv-key-handler:shortcuts-toggle` so a TV shortcuts * overlay can be registered independently from the desktop-ui overlay. */ protected addHelpKey(): void; /** * Builds and displays the Info OSD. Fires `plugin:tv-key-handler:info` for an * external TV shell overlay, then also calls `osdMessage` as the built-in * fallback. */ private showInfoOsd; private resolveTitle; private resolveChapterLabel; /** * Sends a message to the OSD. Routes through `MessagePlugin` when it is * mounted on the player, then also emits `display-message` for consumers that * prefer the event surface. */ private osdMessage; } export declare const tvKeyHandlerPlugin: typeof TvKeyHandlerPlugin;