$ show shaka-project/shaka-player
Shaka Player is a production-grade, client-side JavaScript library for adaptive media streaming in web browsers. It implements the full DASH and HLS manifest parsing pipelines, DRM integration via Encrypted Media Extensions, and a comprehensive plugin system for ad insertion, text display, transmuxing, and device-specific quirks. The architecture is modular with clear separation of concerns: a core Player class orchestrates manifest parsers, streaming engines, ABR algorithms, and UI controls. Key capabilities include offline storage (IndexedDB), CMCD/CMSD metrics reporting, closed captions (CEA-608/708, WebVTT, TTML), and experimental MoQT streaming support. The codebase is heavily tested with over 1,000 unit and integration tests and runs in CI against real browsers and devices (Tizen, Chromecast, Xbox). It is not a data research project; it is a reusable software library designed for embedding in web applications.
The LLM identified 5 files worth highlighting for reuse:
An isolated, callback-based ISO BMFF (MP4) box parser. Walks the box hierarchy and invokes user hooks on full boxes, containers, and sample descriptions. No internal dependencies on Shaka state; works on any ArrayBuffer. Demonstrates clean recursive descent parsing with minimal overhead.
Implements an Exponentially Weighted Moving Average with configurable half-life and clamp. Used by the ABR manager for bandwidth estimation but entirely self-contained. Provides a generic smoothing filter usable in any time-series context.
A generic lazy-evaluation container. Defers object creation until first access and caches the result. Thread-safe for synchronous usage. Useful for deferring expensive initialization. No external dependencies.
Provides a pattern for cancellable asynchronous operations with chaining (AbortableOperation.all, chain, finally). Allows abort propagation across nested operations. Clean separation of cancellation logic from business logic.
A wrapper around setTimeout/setInterval with methods for one-shot and repeating callbacks. Supports tickNow, tickAfter, tickEvery, and stop. Debug builds track active timers for leak detection. Self-contained, no internal imports.