Skip to content

feat: NativePlayer provider + cinema docs site#14

Merged
karngyan merged 2 commits into
mainfrom
feat/native-provider-and-docs
Jun 28, 2026
Merged

feat: NativePlayer provider + cinema docs site#14
karngyan merged 2 commits into
mainfrom
feat/native-provider-and-docs

Conversation

@karngyan

Copy link
Copy Markdown
Collaborator

Summary

Two cohesive pieces of work from one session:

  1. A native provider — play a raw media URL (mp4/webm/ogg) through a plain <video> element behind kino's glass chrome.
  2. A rebuilt docs site — the demo graduates from a single-page playground to a multi-page docs site in a new "cinema" visual direction.

Native provider

A peer to the Mux provider, exported from @karnstack/kino/native:

import { NativePlayer } from "@karnstack/kino/native"
import "@karnstack/kino/styles.css"

<NativePlayer src="https://example.com/clip.mp4" poster="…" />
  • createNativeProvider / NativePlayer / NativeProviderOptions / NativeTextTrack.
  • No streaming engine, no account. Quality switching hides itself (no rendition ladder).
  • Supports posters, sidecar caption tracks (rendered in kino's overlay), playback-rate persistence across source swaps, PiP, fullscreen (incl. iOS native), and OS media keys.
  • detectIOS extracted to src/util/platform.ts and shared with the Mux provider.
  • New provider.test.ts (10 tests); ships as dist/native.js (~10 kB, gzip 3.1 kB) with no @mux/mux-video pulled in.

Docs site (demo)

Multi-page docs site — Overview, Providers, Theming, Install & API — with sidebar nav, a mobile nav drawer, and a footer. Cinema direction: warm near-black, film-leader amber + countdown red, Fraunces display over Geist / Geist Mono.

  • Provider-aware live PlayerStudio (Mux ↔ Native toggle, accent + corner-radius controls).
  • Shiki syntax highlighting on code blocks (dev-only, lazy-loaded chunk — the landing page bundle is unchanged; only the 4 grammars used are bundled).
  • Package-manager tab bar on the install command (pnpm / npm / yarn / bun, default pnpm).
  • Tiny History-API router; wrangler.jsonc gets a single-page-application fallback for deep links.
  • Grain texture gated to hi-DPI so low-density screens stay clean.
  • Refreshed README banner + screenshot (rounded corners, amber/cinema brand).

Verification

  • pnpm test — 56 passed
  • pnpm typecheck · pnpm lint · pnpm format:check — clean
  • pnpm build (library) and vite build (demo) — clean
  • All four pages screenshot-verified desktop + mobile; native playback confirmed in-browser.

Notes

  • A changeset is included (minor): the native provider.
  • Shiki is a devDependency (demo only) — it never ships in the published package (src/ doesn't import it).

🤖 Generated with Claude Code

Adds a `native` provider that plays a raw media URL (mp4/webm/ogg) through a
plain <video> element behind kino's glass chrome — a peer to the Mux provider,
exported from @karnstack/kino/native (NativePlayer / createNativeProvider). No
streaming engine, no account; quality switching hides itself when there are no
renditions. Supports posters, sidecar caption tracks, playback-rate persistence
across source swaps, PiP, fullscreen, and OS media keys.

Rebuilds the demo from a single-page playground into a multi-page docs site in a
"cinema" visual direction (warm near-black, film-leader amber, Fraunces display):
Overview, Providers, Theming, and Install & API pages with sidebar nav, a
provider-aware live PlayerStudio, Shiki-highlighted code blocks, and a
package-manager tab bar. Refreshes the README banner and screenshot.

- src/native: provider, NativePlayer component, tests; /native entry + export
- src/util/platform: shared detectIOS (extracted from mux/urls)
- demo: router, shell, four pages, cinema design system, dev-only Shiki
- assets: new amber banner + docs screenshot (rounded corners)
- wrangler: single-page-application fallback for client-side routing

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
kino 73b412c Commit Preview URL

Branch Preview URL
Jun 28 2026, 08:10 AM

- swapSource refreshes the OS media-session title (extract setSessionMetadata,
  reused by setup + swap) so a source change no longer leaves a stale title
- NativePlayer effect depends on the primitive metadata.videoTitle so a
  title-only change propagates without re-swapping every render; document which
  props are reactive vs mount-only
- detectIOS now catches iPadOS desktop-mode (Macintosh UA + maxTouchPoints);
  both providers pass navigator.maxTouchPoints (backward-compatible default 0)
- tests: default-track selection, no-default null, rate survives swap, iPad
  detection

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@karngyan karngyan merged commit fe7a833 into main Jun 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant