Skip to content

feat: add per-track segmentation init mode#549

Open
lideen wants to merge 1 commit intogpac:mainfrom
lideen:feat/per-track-init-segmentation
Open

feat: add per-track segmentation init mode#549
lideen wants to merge 1 commit intogpac:mainfrom
lideen:feat/per-track-init-segmentation

Conversation

@lideen
Copy link
Contributor

@lideen lideen commented Feb 23, 2026

Summary

This PR adds a new segmentation initialization mode to support one init segment per fragmented track while preserving the existing combined-init behavior.

The main motivation is Media Source Extensions (MSE) integration: playback setups that require simultaneous multi-audio playback need one MediaSource (containing its SourceBuffer) per track, which in turn requires one init segment per track instead of a single combined init segment.

Note

This behavior aligns with historical usage, per-track initialization used to be the default behavior.
It stopped being the default in commit 77247e1 (fix: segmenting will also multiplex the fragmented tracks, Jul 8, 2025), first released in v1.3.1.

initializeSegmentation now supports:

  • initializeSegmentation() / initializeSegmentation('combined') (default):
    returns a single init segment containing all selected fragmented tracks.
  • initializeSegmentation('per-track'):
    returns one init segment per selected fragmented track.

Documentation

Updated README.md segmentation docs (it seems to have been stale documenting the old behavior before 77247e1):

  • documented initializeSegmentation(mode) with supported values ('combined' and 'per-track')
  • updated examples to reflect current return shapes
  • fixed the setSegmentOptions anchor link

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.

1 participant