video-dev / video-dev/hls.js

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

Open
#7,534 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Feature proposal
Dominant language
TypeScript
Stars
16.9k
Forks
2.8k
Avg merge
1d 12h
Merged PRs (30d)
27

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how Hls.js currently exposes and selects alternate audio and subtitle renditions, then compare that flow with the provided multi-video manifest and the HLS EXT-X-MEDIA specification. Done means video tracks are exposed for runtime selection while bitrate or quality levels remain available within each track.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
audio-video-rtc, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.