# Changelog

All notable changes to **Spark Player** are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- **Mini player**: when the stage scrolls out of view during playback, a bottom-right dock
  (`.spark-mini`) shows the title, poster thumbnail, play/pause, back-to-player and close
  actions; hidden during PiP/fullscreen and when paused.
- **Keyboard shortcuts dialog**: press `?` (or the new entry in the settings menu) to open an
  accessible panel (`role="dialog"`) listing every transport binding, with `Tab` trapping,
  `Escape`/backdrop/close dismissal and focus restoration.
- i18n: 12 new keys (`mini`, `miniBack`, `miniClose`, `shortcuts`, `scPlay`, `scSeek`,
  `scVolume`, `scMute`, `scFullscreen`, `scTrack`, `scHelp`, `scClose`) across all 11 locales.
- **Multi-source codec fallback**: `PlaylistItem.sources` renders `{ src, type }` candidates as
  `<source>` children so a browser picks the first encoding it can decode — WebM/MP4 pairs now
  play in Chromium builds shipped without H.264. `src` stays authoritative for kind detection,
  resume keys and metadata probing. When no candidate is decodable the player emits `error`
  with code `no-source-supported` (bound to the last candidate, since a `<video>` with
  `<source>` children never fires `error` itself). Re-mounting an item purges stale `<source>`
  children and the opposite of whichever of `src`/children is being applied.

### Planned

- AirPlay and Chromecast support.
- Playlist drag-to-reorder.

## [1.1.0] - 2026-11-07

### Added

- **Resume playback** with `startTime` (per item or for the first item), persisted per-item
  positions (`resume`, `resumeThreshold`), and a new `resume` event.
- **Toast notifications** via `player.toast(message, kind)`: themeable, dismissible,
  `aria-live`, auto-dismiss configurable with `toastDuration`, and wired into blocked
  autoplay, provider errors and resume notices (`toastshow` event).
- **Additional locales**: Spanish, French, German, Japanese, Korean and Brazilian Portuguese
  join the five existing bundles (11 total) with complete key parity; `availableLocales`
  lists them. Regional variants fall back to their base language.
- **React wrapper** at `spark-player/react`: StrictMode-safe mount/unmount, typed event
  handlers, an imperative ref handle and optional React peers, shipped as ESM/CJS with
  declarations.
- **WordPress integration** in `wordpress/`: a `[spark_player]` shortcode, a server-rendered
  Gutenberg block, sanitized attribute mapping and a browser-safe `spark-player.umd.js` alias.

## [1.0.0] - 2026-11-06

First stable release. A dependency-free, TypeScript HTML5 video player with a smart,
paginated playlist.

### Added

- **Multi-source playback** with automatic kind detection for MP4, WebM, HLS (m3u8) and
  YouTube, Vimeo, Dailymotion and Facebook embeds. Optional `hls.js` peer is loaded lazily
  for browsers without native HLS.
- **Smart playlist** with pagination (4, 6 or 8 per page, or all), autoplay-next, active-item
  tracking, and a responsive bottom-sheet layout on small screens.
- **Automatic metadata probing** (duration and poster) for local files and third-party links,
  with per-item overrides.
- **Six built-in themes** — Glass, Neon, Desert, Glass Light, Neon Light and Midnight — all
  driven by `--spark-*` CSS custom properties.
- **Professional controls**: progress bar with buffer and chapter markers, thumbnail seek
  previews, volume, playback-rate menu, quality/level menu, captions menu, picture-in-picture,
  fullscreen and next/previous.
- **Captions and chapters**: WebVTT sidecar subtitles per item, a captions menu, and chapter
  markers rendered on the timeline.
- **Developer API**: imperative methods for playback, audio, view, theme, content and playlist
  control, plus `getState()` and typed getters.
- **25 typed events** via `on()`, `once()` and `off()` — including `ready`, `play`, `playing`,
  `pause`, `ended`, `timeupdate`, `seeking`, `seeked`, `volumechange`, `ratechange`,
  `durationchange`, `buffering`, `progress`, `fullscreenchange`, `pipchange`, `error`,
  `sourcechange`, `playlistchange`, `paginationchange`, `itemclick`, `themechange`,
  `captionschange`, `qualitychange` and `destroy`.
- **Internationalisation** with bundled `en`, `en-US`, `en-GB`, `zh` and `zh-CN` locales and a
  `createI18n()` helper for custom strings.
- **Zero-build usage** via CDN ES modules and a UMD bundle, plus a `<spark-player>` custom
  element and `autoInit()` for declarative markup.
- **Persistence** of theme, volume, rate, captions and the last item via `localStorage`
  (configurable, can be disabled).
- **Full keyboard accessibility**: play/pause, seek, volume, mute, fullscreen and next/prev,
  with ARIA roles and focus management.
- **Complete TypeScript types** shipped with the package, covering options, state, playlist
  items, events and CSS-variable-friendly theme tokens.

### Notes

- Runtime dependencies: **none**. `hls.js` is an optional peer for adaptive HLS.
- Requires modern evergreen browsers; Safari plays HLS natively.

[Unreleased]: https://github.com/spark-player/spark-player/compare/v1.1.0...HEAD
[1.1.0]: https://github.com/spark-player/spark-player/releases/tag/v1.1.0
[1.0.0]: https://github.com/spark-player/spark-player/releases/tag/v1.0.0
