Skip to content

Support switching alternate video renditions (as you do for audio) #7534

Description

@danihorvath

Is your feature request related to a problem? Please describe.

Hls.js currently supports alternate renditions for audio (TYPE=AUDIO) and subtitles (TYPE=SUBTITLES) as defined in the HLS spec. However, alternate video renditions (TYPE=VIDEO) are not supported. This prevents users from switching between multiple camera angles or video streams when they are defined in the manifest.

Describe the solution you'd like

I would like Hls.js to support the #EXT-X-MEDIA:TYPE=VIDEO tag, in the same way it already does for audio and subtitle tracks. Specifically:

  • Expose video tracks in the API, similar to audio tracks.
  • Provide the ability to programmatically select a video track at runtime.
  • Keep the existing levels feature (bitrate/quality switching) available within each video track, so users can still benefit from adaptive bitrate streaming for every video angle.

Additional context

The HLS specification explicitly defines support for alternate video tracks:
https://developer.apple.com/documentation/http-live-streaming/adding-alternate-media-to-a-playlist

For a practical example, I have created the following stream, which includes multiple video tracks:
https://danihorvath.github.io/hls-multivideo/master.m3u8

I found a related issue (hls.js #1825), but it has been closed.

Activity

  1. added
    Needs TriageIf there is a suspected stream issue, apply this label to triage if it is something we should fix.
    on Sep 11, 2025
  2. robwalch commented on Mar 10, 2026

    @robwalch
    Collaborator

    Ideally, level-controller would create the alternate variants (Level[]) expose a method for switching (emit LEVELS_UPDATED), with variant filtering based on the active video group.

    Understanding the audio-track and content-steering controllers and how to apply what they do to level-controller is a good start. content-steering replaces Level[] based on Pathways by emitting LEVELS_UPDATED. The audio-track controller has some group management and selection logic that is relevant, but not so much that it could be copied.

  3. added
    Revisit-at-later-release-cycleWill revisit during release cycle indicated by the Milestone
    and removed
    Needs TriageIf there is a suspected stream issue, apply this label to triage if it is something we should fix.
    on Mar 10, 2026
  4. added this to the 1.8.0 milestone on Jun 24, 2026
  5. removed this from the 1.8.0 milestone on Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions