Hooks
Feature hooks and utilities for media player state management.
Limeplay hooks fall into two categories:
Feature Hooks
Each feature hook provides a store slice, event listeners, and optionally a Setup component. Register them in createMediaKit.
| Hook | Store Key | Description |
|---|---|---|
use-media | media | Base media element reference and idle state |
use-player | player | Shaka Player initialization and asset loading |
use-playback | playback | Play/pause, status, loop, error state |
use-volume | volume | Volume level, mute, audio detection |
use-timeline | timeline | Current time, duration, seeking, buffered ranges |
use-playlist | playlist | Queue management, shuffle, repeat modes |
use-playback-rate | playbackRate | Playback speed control |
use-picture-in-picture | pictureInPicture | PiP mode toggle |
use-captions | captions | Text track management |
use-asset | asset | Higher-order hook combining player + playlist |
Utility Hooks
Standalone hooks that don't require feature registration:
| Hook | Description |
|---|---|
use-seek | Seek by offset (±N seconds) |
use-idle | Detect user inactivity |
use-interval | setInterval with auto-cleanup |
use-track-events | Pointer event handling for sliders |