feat: add per-track segmentation init mode#549
Open
lideen wants to merge 1 commit into
Open
Conversation
Member
|
@lideen Could you resolve the conflicts and add a changeset? I can then merge this, thanks. |
a9613c4 to
d2f3e15
Compare
🦋 Changeset detectedLatest commit: ddeed03 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
d2f3e15 to
16b15bd
Compare
16b15bd to
ddeed03
Compare
Contributor
Author
done, thanks |
DenizUgur
reviewed
May 25, 2026
|
|
||
| // Write the initialization segments to the output stream | ||
| out.insertBuffer(init.buffer); | ||
| out.insertBuffer(MP4BoxBuffer.fromArrayBuffer(init.buffer, offset)); |
Member
There was a problem hiding this comment.
Could you also revert these changes? Were TypeScript complaining without it? If not, could you also make sure your new tests are using the same syntax?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 itsSourceBuffer) 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 inv1.3.1.initializeSegmentationnow 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.mdsegmentation docs (it seems to have been stale documenting the old behavior before 77247e1):initializeSegmentation(mode)with supported values ('combined'and'per-track')setSegmentOptionsanchor link