Architecture

Vinyl is an HTML5 playback engine designed for high-performance streaming of DASH and HLS content. The architecture follows a modular design with clear separation of concerns, enabling extensibility through dependency injection.

Core Components

                            +-------------+
                            | VinylPlayer |
                            +------+------+
                                   |
                    +--------------+-----------------+
                    |              |                 |
                    v              v                 v
            +---------------+ +----------+   +----------------+
            |TrackController| |Playback  |   |DrmController   |
            |               | |Controller|   |                |
            +-------+-------+ +----+-----+   +-------+--------+
                    |              |                 |
                    v              v                 v
            +---------------+ +-----------+   +-----------+
            | Track         | | Media     |   | EME       |
            | (Dash/Hls)    | | Element   |   | (Browser) |
            |               | | (Browser) |   |           |
            +-------+-------+ +-----------+   +-----------+
                    |   |
                    |   +----------------------+
                    v                          v
            +-------------------+     +----------------+
            |BufferingController|     |SourceBuffer    |
            |                   |     |Controller      |
            +----------+--------+     +--------+-------+
                       |                       |
                       v                       v
            +-------------------+     +----------------+
            |SegmentController  |     |SourceBuffer    |
            |                   |     |(Browser)       |
            +----------+--------+     +----------------+
                       |
                       v
            +-------------------+
            |SegmentProvider    |
            |                   |
            +-------------------+

Component Ownership

VinylPlayer

Main entry point that orchestrates all streaming components and provides the public API.

TrackController

Manages the lifecycle of streaming tracks and maintains a playback queue.

PlaybackController

Controls the HTML5 media element and manages playback state transitions.

DrmController

Handles encrypted content by managing DRM licenses and key exchanges.

Track (DashTrack/HlsTrack)

Protocol-specific implementation that coordinates manifest parsing and media streaming.

BufferingController

Manages the MediaSource buffer by coordinating segment appending and buffer health.

SegmentController

Manages segment caching and prioritization while coordinating with providers for media locations.

SegmentProvider

Resolves media segment locations and handles the actual fetching of segment data.

QualitySelector

Determines optimal playback quality based on network conditions.

ManifestController

Parses and manages streaming manifests, handling updates and transformations.