# Player playback options

Covers seek previews, the sleep timer, stream failover, remembered volume and
brightness, and speed presets. Settings are stored in
`DbSettings.features.player` (`DbPlayerPreferences`). Defaults keep the
previous behavior.

## Seek previews

- Sources can supply a WebVTT thumbnail track through `thumbnailTrack`
  (or `thumbnails`) on the video object. A subtitle entry labelled `thumbnails`,
  `sprites` or `storyboard` is treated as that track and removed from the
  subtitles.
- Cues point to whole images or sprite tiles (`#xywh=`). Relative URLs resolve
  against the track URL. The track and sprite sheets are fetched with the
  stream's headers.
- While the seek bar is dragged, the tile for the target time is shown above
  the thumb. Each sheet is loaded on first use and kept for that stream. A new
  stream cancels outstanding loads. Failed requests are logged and not retried.
- Works on all platforms through shared HTTP and image decoding. Browsers also
  need CORS on the image host.

## Sleep timer

- The player's timer menu offers Off, 5, 15, 30, 45, 60 or 90 minutes, or End of
  episode. The remaining minutes (or "End") are shown on the button.
- When it is due, playback pauses and the timer clears. It is held per profile
  session, so it continues across episode changes. It is not persisted across
  restarts.

## Stream failover

- Off by default (`switchStreamOnFailure`). When a stream reports a playback
  error, it is marked failed for the episode, and the next untried stream loads
  at the current position.
- Each stream is tried at most once, so failover cannot loop. When none remain,
  or failover is off, the player shows the error.
- Errors come from mpv end-file errors and load timeouts, and from
  compose-mediaplayer's error state (web and fallback backends).

## Volume and brightness

- The player sheet has a volume slider (0–100 %) on the audio tab and a
  brightness slider on the video tab. "Use system brightness" removes the
  override.
- With Remember volume or Remember brightness on (both off by default), the
  last value is saved after it settles and restored in later sessions.
- Volume uses mpv `volume` or compose-mediaplayer's volume. Brightness sets the
  window brightness on Android and `UIScreen` brightness on iOS, restoring the
  previous value on exit. On desktop and web there is no app-controlled display
  brightness, so the video is dimmed with an overlay instead.

## Speed presets

- `speedPresets` defaults to the previously offered speeds (0.25–2.0 in steps of
  0.25). Edit them in Internal player settings as a comma-separated list. Values
  must be within 0.25–4; they are rounded to two decimals, deduplicated and
  sorted, and an invalid list is rejected.
- The player's speed button opens a menu of the presets instead of cycling. The
  default-speed choice uses the same presets.

## Verification

2026-10-18: `PlaybackPoliciesTest` (6), `MpvFeaturesTest` (5),
`ComposeControllerRetirementTest` (2) and `VideoFromJsonTest` (2) passed on
desktop JVM and Kotlin/Wasm. The focused desktop run of the media, player and
codec packages passed 169 tests. Android, iOS simulator, desktop and Wasm
compiled.
