Developer pain points
Each entry lists:
- the problem,
- evidence (issues, threads, docs),
- how Tomato answers it with a concrete design decision.
Issue comment counts were read from the GitHub search API on 2026-11-21.
Summary
| # | Pain point | Severity | Tomato answer (short) |
|---|---|---|---|
| 1 | SSR / hydration crashes | High | Zero DOM access at import time. SSR-renderable markup. CI runs an SSR smoke test. |
| 2 | Bundle size | High | Per-feature packages. Engines lazy-loaded. Size budgets enforced in CI. |
| 3 | Styling and customization | High | CSS custom properties, data-* state, ejectable skins, no Shadow DOM by default |
| 4 | iOS Safari fullscreen and inline playback | High | Explicit fullscreen strategy object. playsinline on by default. Documented fallback. |
| 5 | Autoplay policies | High | autoplay returns a typed result. Muted-autoplay fallback. Never rejects silently. |
| 6 | Memory leaks / destroy in SPAs | High | Single destroy() contract, AbortController for all listeners, leak test harness |
| 7 | React re-render / Strict Mode | Med | Idempotent mount. External store with useSyncExternalStore. |
| 8 | Captions styling and rendering | Med | Custom cue renderer with token styling. Native ::cue fallback in native fullscreen. |
| 9 | Accessibility gaps | High | WCAG 2.2 AA as a release gate. Axe tests and keyboard maps per skin. |
| 10 | Abandoned libraries | High | Thin adapters, stable provider contract, governance doc |
| 11 | TypeScript types | Med | TS-first. Typed events and state. Types tested with tsd or expect-type. |
| 12 | Ad integration | High | Ads as a provider-level plugin with a pause/resume contract. IMA loaded at runtime. |
| 13 | DRM complexity | Med | DRM is a config schema mapped to each engine. Shaka recommended for DRM. |
| 14 | Live / DVR edge cases | Med | Unified live state slice: liveEdge, seekableWindow, atLiveEdge, latency |
1. SSR / hydration
- Problem: many players touch
window,documentorcustomElementswhen imported. They crash Next.js, Nuxt and SvelteKit builds or cause hydration mismatches. - Evidence:
- Plyr: "doesn't work on next.js 14" (#2770).
- Plyr: static import breaks in Node >= 21 (#2853).
- Plyr: Angular Universal (#1443).
- ReactPlayer: Next.js / React 18 hydration error, 24 comments (#1474).
- Vidstack: "Cannot find module react-dom/server" (#717).
- Video.js v10 needs a dedicated Vue guide for custom-element config. Its i18n guide covers "server rendering".
- Tomato answer:
- Core and skins have no side effects at import (
"sideEffects": falseexcept CSS). - Custom-element registration happens in an explicit
define()entry. - Framework bindings render real markup on the server: poster, controls skeleton and aspect-ratio box. This gives zero layout shift.
- The engine attaches in
onMounted/useEffect. - CI runs SSR smoke tests on Next (App Router), Nuxt, SvelteKit, Astro and Node 22/24.
- Core and skins have no side effects at import (
2. Bundle size
- Problem: engines are 174-282 kB gz for the full entry. Players often bundle an engine even for MP4. "Import everything" APIs defeat tree-shaking.
- Evidence:
- bundlephobia (2026-11-21), min+gz full entry: hls.js 174.3 kB, Shaka 282.3 kB, dash.js 233.8 kB, mux-player 306.2 kB, @clappr/player 242.7 kB.
- Video.js says unbundling ABR was the main driver of v10's size cut (beta post).
- Tomato answer:
@tomato/coretargets ≤ 10 kB gz. Default skin targets ≤ 15 kB gz. Both use native playback only.- Engines load through
import()only when the source type needs them, and are skipped on Safari when native HLS is preferred. - Size budgets run per package in CI with
size-limit. A public size table regenerates each release, using bundlephobia-compatible numbers and stating the method.
3. Styling and customization
- Problem: players fall into two traps:
- Opaque class soup with high specificity (v8, Plyr).
- Shadow DOM that blocks styling (web-component players). The result is CSS override wars, CSP issues from inline styles, and forks.
- Evidence:
- Tomato answer:
- Light DOM by default.
- State is exposed as
data-*attributes, such asdata-pausedanddata-fullscreen. - Theming uses design tokens as CSS custom properties, plus
@layer tomatoso user CSS always wins without!important. - No inline
stylewrites except CSS variables, which keeps strict CSP clean. npx tomato eject <skin>copies the skin source into the app.
4. iOS Safari: fullscreen, inline playback, native HLS
- Problem:
- iPhone Safari supports fullscreen only on the
<video>element (webkitEnterFullscreen), not on a container div. Custom controls and overlays disappear in native fullscreen. - Without
playsinline, video takes over the screen. - iOS has native HLS. MSE arrived on iPhone only as
ManagedMediaSource(Safari 17.1).
- iPhone Safari supports fullscreen only on the
- Evidence:
- Apple forums: Fullscreen API on non-video element.
- WebKit bug 240312.
- web.dev mobile playback guide.
- WebKit: video policies for iOS.
- Safari 17.1 features (ManagedMediaSource).
- hls.js
preferManagedMediaSourceand AirPlay detach behaviour (API.md). - Plyr "Fullscreen on iPad", 22 comments (#768).
- hls.js AirPlay issue on iOS (#6482).
- Tomato answer:
fullscreenis a strategy:container(Fullscreen API), thennative-video(iOS fallback), thenpseudo(CSS fixed overlay that keeps custom UI). The order is configurable.- State reports which mode is active, so the skin can adapt.
playsinlineis on by default.- The provider selection matrix is documented and testable. On Safari, prefer native HLS unless the user needs features native HLS lacks (CMCD, custom ABR). In that case use hls.js with
ManagedMediaSource. - A real-device test lane covers iOS through BrowserStack or a similar service.
5. Autoplay policies
- Problem:
play()rejects under the browser autoplay policy. Libraries often swallow the rejection, or users see a frozen poster. Ad SDKs compound this. - Evidence:
- Chrome autoplay policy.
- WebKit iOS policies.
- Video.js "Autoplay not working on chrome", 44 comments (#4720).
- videojs-ima "robust support for autoplay", 27 comments (#341).
- Chrome 66 preroll hang (#635).
- Tomato answer:
autoplay: 'muted-fallback' | 'strict' | false.player.play()resolves to a typed result:{ ok: true } | { ok: false, reason: 'not-allowed' | 'aborted' | 'source-error' }.- A built-in "tap to unmute" affordance appears when autoplay falls back to muted.
- A
canAutoplay()probe is available.
6. Memory leaks and destroy in SPAs
- Problem: engines and UIs leak listeners, workers, MSE buffers,
ResizeObserverinstances and text-track cues across route changes. Many players lack an idempotent destroy. - Evidence:
- hls.js "Possible memory leak w/ multiple Hls players", 68 comments (#1220).
- hls.js live VTT cues never cleaned up (PR #2309).
- dash.js subtitles leak of about 20 MB/hour (#4290).
- dash.js 608 parser and
ResizeObserverleaks fixed 2026-06 (PR #5042). - Shaka ABR leak on destroy (PR #5149).
- Plyr "Destroy Method" (#77).
- Video.js "m3u8 not release memory" (#5567).
- Tomato answer:
- Every module receives an
AbortSignalscoped to the player. All listeners, observers and timers register through it. destroy()is async, idempotent, and awaits provider teardown:hls.destroy(),shaka.destroy(), and clearingsrcplusload().- The test suite mounts and unmounts 100 players and asserts heap and listener counts in Playwright with CDP.
- Every module receives an
7. React re-render and Strict Mode
- Problem: imperative players inside React break under Strict Mode double-mount. Props changes re-create the player. High-frequency
timeupdatestate re-renders the whole tree. - Evidence:
- Video.js "React 18 StrictMode does not work with typical usage" (#7746).
- The official guide needs ref guards and an
isDisposed()check (legacy guide). - Plyr + React, 21 comments (#254).
- Vidstack initial
volume/mutedprops not respected, 21 comments (#1416).
- Tomato answer:
- The player is an external store. React reads it with
useSyncExternalStoreand selectors:usePlayer(s => s.paused). - Time display components subscribe directly, not through React state.
- Mount is idempotent and survives Strict Mode.
- Initial props become initial state; later prop changes become commands, so the player is never re-created.
- Vue (
shallowRef+ composables) and Svelte (stores/runes) follow the same pattern.
- The player is an external store. React reads it with
8. Captions styling and rendering
- Problem:
::cuestyling is limited and inconsistent across browsers. Custom renderers do not apply in iOS native fullscreen. Users need caption settings (size, background) for accessibility. ASS/SSA needs a heavy WASM renderer. - Evidence:
- Tomato answer:
- A DOM cue renderer styled by tokens, with a persisted user caption-settings panel.
- Native tracks are kept in sync, so iOS native fullscreen still shows captions through
::cue. - VTT parsing runs off the main thread for large files.
- ASS/SSA is an opt-in
@tomato/plugin-assplugin using JASSUB, lazy-loaded.
9. Accessibility gaps
- Problem: players ship controls without proper roles, labels, focus order, or keyboard support. Screen readers do not hear announcements. Audits fail WCAG AA.
- Evidence:
- Plyr "Multiple Issues making player invalid for WCAG 2.0 AA", 48 comments (#905).
- Plyr follow-ups #1794 and #2834.
- Video.js captions dialog labelling (PR #3281).
- W3C WAI media guide.
- Tomato answer:
- WCAG 2.2 AA is a release gate for every official skin. CI runs axe-core, and a manual screen-reader checklist (VoiceOver and NVDA) runs per release.
- Keyboard shortcuts are scoped to the focused player, never to the global page.
- A live region announces seek, volume and caption changes.
prefers-reduced-motionis respected.- The skin contract requires a documented keyboard map.
10. Abandoned or deprecated libraries
- Problem: teams bet on a UI layer that then dies.
- Evidence:
- Plyr is deprecated. Vidstack is security-only until Jan 2028 (npm READMEs).
- flv.js has not been pushed since 2024-07, with 450 open issues.
- clappr-core and castable-video are archived. libass-wasm has had no release since 2022.
- The
video.jsnpmlatesttag now ships no player, which surprises v8 users (llms.txt).
- Tomato answer:
- Keep the dependency surface small and swappable. Each third-party library sits behind a provider or plugin interface. Replacing one is a one-package change.
- Publish
GOVERNANCE.md, a support/LTS policy, and migration codemods from Plyr, Vidstack and v8 to win orphaned users.
11. TypeScript types
- Problem: types are missing, hand-written, or loose:
anyevents, untyped plugin options. - Evidence:
- Plyr typings arrived as a community PR (#1521).
- IMA types live in DefinitelyTyped
@types/google_interactive_media_ads_types(Google guide). - Video.js v10 needs a dedicated TS module-resolution guide (index).
- Tomato answer:
- Written in strict TS.
- Typed event map:
player.on('qualitychange', e => e.detail.level). - Plugin options are inferred through declaration merging.
- Types are tested.
- Ships ESM only with an
exportsmap andtypesconditions.
12. Ad integration
- Problem: IMA needs its own ad container, conflicts with custom controls, and has iOS and autoplay failures. Error paths leave the player hung.
- Evidence:
- Tomato answer:
- An
adsstate slice:adPlaying,adBreak,skippableIn. The skin switches to ad mode from this state. - A plugin contract (
requestAds,onContentPauseRequested,onContentResumeRequested) has adapters for IMA (loaded at runtime from Google's URL) and VAST-only. - A watchdog timeout always resumes content after an ad error.
- An
13. DRM complexity
- Problem: each engine has a different DRM config. FairPlay on Safari needs certificates and custom license request and response handling. Native HLS and MSE paths differ.
- Evidence:
- Tomato answer:
- A single
drmschema ({ widevine, playready, fairplay: { certificateUrl, licenseUrl, prepareLicenseRequest } }), translated by each adapter. - Shaka is the recommended DRM adapter.
- A
drmSupport()probe usesrequestMediaKeySystemAccess. - A test matrix lives in the docs.
- Tomato does not implement EME itself.
- A single
14. Live / DVR edge cases
- Problem: behaviour differs by engine:
- live-edge snapping,
- seeking in an unbuffered DVR window,
duration = Infinity,- "Live" badge state,
- low-latency catch-up.
- Evidence:
- Tomato answer:
- A normalized
liveslice:streamType: 'on-demand' | 'live' | 'live-dvr',seekableStart,liveEdge,atLiveEdge(with tolerance),latency,targetLatency. - The timeline component renders the DVR window, not
duration. - Each adapter maps its engine to the same slice. Conformance tests use the same test streams for every adapter.
- A normalized