Implement DASH Annex I (URL parameters) for segment requests - #1884
Open
peaBerberian wants to merge 1 commit into
Open
Implement DASH Annex I (URL parameters) for segment requests#1884peaBerberian wants to merge 1 commit into
peaBerberian wants to merge 1 commit into
Conversation
peaBerberian
force-pushed
the
dash-annex-i-logic
branch
5 times, most recently
from
August 24, 2026 19:51
b2175b0 to
f1a067f
Compare
peaBerberian
force-pushed
the
dash-annex-i-logic
branch
from
August 25, 2026 10:04
f1a067f to
d73ab01
Compare
peaBerberian
force-pushed
the
dash-annex-i-logic
branch
from
September 1, 2026 09:43
d73ab01 to
8f640bd
Compare
|
✅ Automated performance checks have passed on commit DetailsPerformance tests 1st run outputNo significative change in performance for tests:
|
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.
Based on #1882
(NOTE: most of the diff are new integration and unit tests, don't be too afraid of looking at it :p!)
What is this
This PR implements a subset of DASH Annex I - Flexible Insertion of URL Parameters, which allows to e.g. indicate in the MPD that additional parameters, like query parameters, should be set on segment or manifest requests.
I've first encountered the need to do it by looking at the final Content Steering specification and how other players implemented it, yet it is not only useful in that context, and the current PR only adds it for segment requests (not to the MPD, not to the Content Steering Manifest - that we do not yet load anyway, not to Event-linked requests etc.).
Use cases
Reading around, the main immediate use case would be "Common Access Token" (CAT) (a more constrained profile of CWT, which is basically binary JWT) support, where a token would be present in the initial MPD's URL and then forwarded in most of the user's subsequent requests.
So basically the frequent "token in segment request" scenario we know some applications have, but specced into DASH instead of having weird HTTP paths or custom segment loader implementations.
A second frequent use case would be SGAI, a specific flavor of ad insertion where some query parameters would be sent alongside HTTP requests triggered due to
Eventelements in the MPD. I did nothing for that second use case for now.But the spec in itself is not constrained to a list of use cases, so MPD creators / CDNs / distributors could choose to rely on them for whatever reason they wish.
It's only a subset
DASH v5 and v6 have a much more comprehensive specification, but the players I looked at (mainly dash.js and shaka-player, exoplayer/media3 doesn't seem to have implemented it) only implement a roughly similar subset.
That both implemented the same thing is not a coincidence. When shaka-player implemented this, they explicitly linked to the original dash.js issue (opened by Will Law, of Akamai, one of the main writers of the spec - also the spec-side person we exchanged with when doing initial content steering drafts) and also to the corresponding livesim2 issue (a "live simulator" allowing to generate testing DASH streams, also developed by DASH-IF).
So it seems dash.js and shaka only did a simpler subset (populating query string from potential query string information present in the source MPD's URL and in the MPD information iteself) that is relatively straightforward, not the more involved things in the specs (like reading headers from each requests, more specific Token-based Access Control etc.).
I did roughly the same subset here, sometimes even going further (e.g.
sameOriginOnlyis not done by the shaka-player, closer to the spec on inheritance logic...) but stopping where implementations would be more complex, mainly to catch-up with what could be expected from a DASH player now that two big players are doing it. But only with segment requests here for now (not with the MPD, though it is also planned).Caveats
While working on this, I noted many points I want to regroup here:
dash.jsandshaka-playerseem to have a similar bug, whereas they interpretincludeInRequests=segmentas both for the media and init segments, whereas my reading ofI.3.6 Parameter source and output optionsof DASH v6 is thatsegmentis explicitly only for media segments andinitis for initialization segment.There are other weird handling of the
includeInRequestsin both, which makes me think this wasn't intentional.Yet as those two aligned with that bug, I chose to replicate the same bug for now, unless both
segmentandinitexists. This is because MPD creators could assume the two previous implementation are actually how it is supposed to be implemented, more than the spec.The current implementation supports the 2014 UrlQueryInfo and 2016 ExtUrlQueryInfo schemes, but not the 2025
<RequestParams>element. The last one is very recent (only in DASH v6) and only the shaka-player supports a part of it for now.I only support query parameters based on the initial MPD's URL and the MPD's content, like other players are doing.
URL construction happens before invoking a custom audio/video segment loader, so custom loaders receive the Annex-I-updated URL.