Web
AuraScore 83/100

Low-Latency HLS Video Player and Server-Side Ad Insertion Technical Spec

Design a resilient web video player architecture with synchronized server-side ad stitching and telemetry for media streaming.

Use this template when building or refactoring modern web video players that require tight live-stream latency, DRM enforcement, and frame-accurate ad insertion. It produces an end-to-end integration specification for front-end media engineers.

Template

Role: Principal Web Video Streaming Architect with 12+ years of experience in MSE/EME implementations, DRM integrations, and OTT web frontends.

Context

  • Target video delivery protocol: {{streaming_protocol}}
  • Ad insertion architecture: {{ad_insertion_type}}
  • Web player foundation library: {{player_framework}}
  • Digital rights management suite: {{drm_provider}}
  • Target end-to-end glass latency: {{target_latency_ms}}
  • Real-time client QoS endpoint: {{telemetry_endpoint}}

Task

Produce an exhaustive web video player integration specification detailing playback initialization, adaptive bitrate switching, server-side ad stitching telemetry, and failover mechanics for media streaming applications.

Method

  1. Define media source extensions (MSE) and encrypted media extensions (EME) initialization pipelines for {{player_framework}}.
  2. Formulate the manifest parsing and segment buffering strategy tailored to {{streaming_protocol}} to maintain {{target_latency_ms}}.
  3. Specify the DRM license acquisition workflow, certificate exchange, and key renewal cycles using {{drm_provider}}.
  4. Map client-side ad event listeners and beacon dispatch logic matching {{ad_insertion_type}} boundary cues.
  5. Design the adaptive bitrate (ABR) algorithm rules, network throughput estimators, and resolution clamp policies for mobile and desktop viewports.
  6. Detail the error recovery state machine covering fatal network drops, decode errors, and manifest drift.
  7. Outline the QoS data pipeline dispatching buffer health, dropped frames, and rebuffering metrics to {{telemetry_endpoint}}.

Constraints

  • MUST specify explicit fallback codecs and MSE source buffer eviction policies.
  • MUST NOT permit blocking UI thread operations during DRM key exchange or manifest parsing.
  • All ad tracking beacons must maintain millisecond-accurate timestamp sync with video playhead state.
  • Target browser compatibility must cover evergreen desktop browsers, Safari on iOS/iPadOS, and TV web runtimes.

Output format

    1. Player Lifecycle & Architecture Diagram (Text-based ASCII)
    1. DRM & EME Integration Flow
    1. Manifest & Low-Latency Buffer Management
    1. Ad Tracking & SCTE-35 Cue Parsing Contract
    1. Error Recovery & Failover State Machine
    1. Telemetry & QoS Payload Definition (JSON Schema) Total length: 800 to 1200 words.

Self-review

  • Ensure all variables ({{streaming_protocol}}, {{ad_insertion_type}}, {{player_framework}}, {{drm_provider}}, {{target_latency_ms}}, {{telemetry_endpoint}}) are directly addressed.
  • Verify that DRM key negotiation includes fallback scenarios for expired session licenses.
  • Check that buffer eviction logic prevents memory leaks on long-running live stream sessions.
AuraScore breakdown
83/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness5/5 · Strong

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-web
media-entertainment
video-streaming
hls
drm