video-dev / video-dev/hls.js

Support delayed create of SourceBuffer

Open
#6,294 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

MSE Not Supported sourcebuffer-track-mismatch Stream Issue
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.

I have an M3U8 playlist with only audio data for the first few seconds, and then both audio and video data are available. At this point, hls.js will report an error because the video sourceBuffer cannot be found. By checking the hls.js code, I learned that the sourceBuffer seems to only be created during initialization based on the track type owned by the first ts file;

image

image
Describe the solution you'd like

Can you support changing existing sourceBuffers based on actual changes in track types? At least for me, I need to adapt to the addition of track types

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 tracing the hls.js initialization path where SourceBuffers are created from the track types in the first TS segment. Review how later audio and video track changes are handled, then define tests for a playlist that begins with audio only and later adds video. Done means the added track type receives a usable SourceBuffer without the reported error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.