# media-runtime Architecture Specification ## Overview & Core Principles `media-runtime` is a zero-copy, worker-isolated, hardware-first TypeScript media engine for modern web browsers. ``` +----------------------------------------------------------------+ | Host Application | +----------------------------------------------------------------+ | +----------------------------------------------------------------------+ | @media-runtime/ui | +----------------------------------------------------------------------+ | +----------------------------------------------------------------------+ | @media-runtime/core | | [Player] <---> [Clock] <---> [Pipeline] <---> [Plugin Registry] | +----------------------------------------------------------------------+ | | | | +-----------+ +---------------+ +------------+ +---------------+ | stream/ | | containers/ | | codecs/ | | renderer/ | | buffer/ | | (10 demuxers)| | (Hardware) | | (WebGL/WebGPU)| +-----------+ +---------------+ +------------+ +---------------+ | | | | +-----------+ +---------------+ +------------+ +---------------+ | manifest/ | | worker/ | | audio/ | | subtitle/ | | abr/ | | (Transfer) | | (Worklet) | | (ASS/SRT/VTT) | +-----------+ +---------------+ +------------+ +---------------+ ``` ### Key Architectural Pillars: 1. **Hardware Decode Priority Chain**: `WebCodecs API → Native