Skip to content

docs: multi-audio-track API design#1636

Open
ronald-urbina wants to merge 4 commits into
videojs:mainfrom
ronald-urbina:docs/audio-track-api-design
Open

docs: multi-audio-track API design#1636
ronald-urbina wants to merge 4 commits into
videojs:mainfrom
ronald-urbina:docs/audio-track-api-design

Conversation

@ronald-urbina

@ronald-urbina ronald-urbina commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Adds a design doc for the multi-audio-track consumer API (issue #1261). SPF already handles audio renditions internally — this doc covers how to surface them through the existing feature/predicate/selector pattern used by streamType and textTrack, and explains why the text track DOM path doesn't apply to audio (MSE vs elements). Meant as a team read before we start coding.

start to resolve 1261


Note

Low Risk
Documentation-only plus a trivial CSS class order change; no runtime or API behavior is modified in this PR.

Overview
Adds internal/design/audio-track-api.md, a draft design for exposing SPF’s existing HLS audio renditions through the same feature / predicate / selector stack as streamType and textTrack (issue #1261).

The doc spells out remaining implementation: wire SimpleHlsMedia with MediaTracksMixin and a SPF-signal bridge (mirroring HlsJsMediaMediaTracksMixin), add audioTrackFeature and selectAudioTrack, and register the feature in all four store presets. It also states non-goals (no SPF engine changes; hls.js path largely done via #1664).

PresetReference.astro only reorders Tailwind classes on a MarkdownCode skin import line (text-code vs inline-block); no preset or API reference data changes.

Reviewed by Cursor Bugbot for commit 47e87ca. Bugbot is set up for automated code reviews on this repo. Configure here.

@netlify

netlify Bot commented Jun 1, 2026

Copy link
Copy Markdown

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit 47e87ca
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/6a32d70b10fbe80008f5db9b
😎 Deploy Preview https://deploy-preview-1636--vjs10-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

@ronald-urbina is attempting to deploy a commit to the Mux Team on Vercel.

A member of the Team first needs to authorize it.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a697759. Configure here.

Comment thread internal/design/audio-track-api.md
Comment thread internal/design/audio-track-api.md Outdated
Comment thread internal/design/audio-track-api.md Outdated

## Proposed Architecture

**Adapter (`SimpleHlsMedia`, in core).** `SimpleHlsMedia` is the boundary where SPF internals meet the rest of the stack. It gains an `audioTracks` read-only property (returning a list of track objects with `id`, `label`, `language`, `kind`, and `enabled`), a `selectAudioTrack(id)` method, and fires an `audiotrackschange` event whenever the track list or active selection changes.

@luwes luwes Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for new API's on the media, they're covered by
https://github.com/muxinc/media-elements/tree/main/packages/media-tracks

Look for the hls.js implementation at #1609

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated!

@ronald-urbina ronald-urbina requested a review from luwes June 2, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Feature: Implement Multi Audio Tracks API for Supported Media Components

2 participants