How vidstack/player works
Project type and purpose
• This is an open-source, monorepo JavaScript/TypeScript library for building production-ready video and audio players. It consists of:
• “vidstack” – the core web-components–based player engine and API
• “@vidstack/react” – a React wrapper on top of the core engine
• Its purpose is to let developers embed, customize, and extend rich media players (layouts, controls, providers for HLS, DASH, YouTube, etc.) in any JS framework.
File structure
• Top-level
• Configuration & metadata (.gitignore, tsconfig.json, pnpm-workspace.yaml, turbo.json)
• Scripts folder (.scripts) for release, sandbox, test automation
• CI workflows (.github/workflows) for build/test/publish
• Examples folder providing starter sandboxes
• packages/
• vidstack/
– src/core: low-level media API, state management, tracks, providers
– src/components: layouts, UI primitives, announcer, gesture handlers
– src/elements: Web Component definitions (customElements.define)
– styles: default and plyr-themed CSS bundles
– build & rollup configs → ESM, CJS, types
• react/
– src/components: React wrappers (hooks, layout components, primitives)
– src/providers: React context providers mapping to core’s implementations
– rollup & vite configs for React distribution
README for additional insights
• Emphasizes “build and ship a production-ready video or audio player,” with quickstarts for JS, React, Angular, etc.
Final advice
• Be very detailed: break down the Core package into its sub-domains (api/state/providers/components/elements/styles).
• Build and publish pipelines as part of the architecture.
• Don’t try to lump everything; separate into as many logical components as needed to show extension and dependency surfaces.