Skip to content

feat(api): add MPEG-DASH streaming support via dash.js - #1190

Merged
lvcabral merged 1 commit into
masterfrom
feat/dash-streaming
Aug 17, 2026
Merged

feat(api): add MPEG-DASH streaming support via dash.js#1190
lvcabral merged 1 commit into
masterfrom
feat/dash-streaming

Conversation

@lvcabral

@lvcabral lvcabral commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds DASH as a second adaptive-streaming backend in src/api/video.ts, alongside the existing hls.js integration, following the same load/play/pause/seek/stop and error-handling shape (create/destroy lifecycle, error-code classification, bandwidth reporting).
  • Audio/subtitle track enumeration and selection for DASH share a common locale-priority selector with the existing HLS path (preferred locale > device locale > English).
  • dash.js is loaded via a dynamic import kept in the main bundle (webpackMode: "eager"): its imsc/TTML dependency touches window at module-load time, which breaks a static import outside a browser (e.g. the Node-based test suite); a real split chunk would also silently require integrators to deploy an extra file beyond the documented brs.api.js + brs.worker.js contract.
  • A load-generation counter guards the one async gap this introduces (the dash.js import) against a stale instance attaching after a newer load or an explicit stop superseded it.
  • videoFormats()/canDecodeVideo() now report "dash" container support.
  • docs/limitations.md updated — DASH is no longer listed as unsupported.
  • This PR closes Add DASH support to roVideoPlayer and Video node #248

Test plan

  • npm run lint / npm run prettier clean
  • Full vitest suite passes (216 test files / 2764 tests)
  • Dev and production browser builds verified to still emit exactly brs.api.js + brs.worker.js (no stray chunk file)
  • Manually verified in a browser against a real public DASH manifest (BBC's elephants_dream MPD): playback starts, audio track enumeration works, position updates, pause/seek/stop behave correctly
  • Went through /code-review and /simplify passes; fixed a load-order race, a dash.js instance memory leak, and de-duplicated the HLS/DASH track-selection and error-reporting code

🤖 Generated with Claude Code

Adds DASH as a second adaptive-streaming backend in src/api/video.ts,
mirroring the existing hls.js integration: load/play/pause/seek/stop,
error handling with recovery, and audio/subtitle track enumeration and
selection sharing a common locale-priority selector with the HLS path.

dash.js is loaded through a dynamic import kept in the main bundle via
webpackMode: "eager" (its imsc/TTML dependency touches `window` at
module-load time, which breaks a static import outside a browser, and
a real split chunk would silently require integrators to deploy an
extra file beyond the documented brs.api.js + brs.worker.js contract).
A load-generation counter guards the resulting async gap against a
stale dash.js instance attaching after a newer load or stop.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@lvcabral
lvcabral merged commit 44b86e6 into master Aug 17, 2026
3 checks passed
@lvcabral
lvcabral deleted the feat/dash-streaming branch August 17, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add DASH support to roVideoPlayer and Video node

1 participant