Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: UrlQueryInfo and ExtUrlQueryInfo support #4578

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

JoaquinBCh
Copy link

This PR implements UrlQueryInfo and ExtUrlQueryInfo

Summary

  • Implement includeInRequests and sameOriginOnly for ExtUrlQueryInfo
  • Implement useMPDUrlQuery and queryString for UrlQueryInfo and ExtUrlQueryInfo
  • Add support for urn:mpeg:dash:urlparam:2014 scheme in the manifest
  • Generate finalQueryStrings when a manifest update is triggered
  • Append finalQueryString to the request url in HTTPLoader
  • Create unit tests to validate useMPDUrlQuery, queryString, includeInRequests and sameOriginOnly

Assumptions

  • The initialQueryString is used to build the list of parameters added to the request, not the finalQueryString. The queryTemplate is not used for the initialQueryString, so it is not considered.
  • For mpd and mpdpatch requests, we return the query string from the properties configured at the manifest level. Properties configured at the Period, AdaptationSet, or Representation levels are not considered.
  • There is no distinction between mpd and mpdpatch when deciding whether to return a query string or not; both types of requests are treated the same.
  • For Media Segments or Initialization Segment requests, all properties configured up to the specific Representation level (manifest, period, adaptation set, and representation) are considered. Properties configured in periods or adaptation sets not related to the representation being requested are not considered.

Testing

Manifests with different UrlQuery configurations for testing:

  • UseMPDUrlQuery
    • The property is added in the video AdaptationSet, and the query parameters present in the manifest request are replicated because useMPDUrlQuery="true".
  • QueryString
    • A query string is added for the video AdaptationSet and in the 1080p Representation.
  • UseMPDUrlQuery and QueryString
    • UseMPDUrlQuery is set to true in the AdaptationSet, and a query string is configured for the video. Therefore, the query parameters from the AdaptationSet are replicated, and those defined in the query string are added.
  • IncludeInRequests segment
    • useMPDUrlQuery="true" in the video AdaptationSet, and includeInRequests is set to segment. The requests sent in the manifest are only added to segment requests.
  • IncludeInRequests mpd mpdpatch
    • useMPDUrlQuery="true" in the video AdaptationSet, and includeInRequests is set to mpd and mpdpatch. The requests sent in the manifest are only added to mpd or mpdpatch requests.
  • SameOriginOnly different origin
    • useMPDUrlQuery="true" and sameOriginOnly="true" in the video AdaptationSet. The origins of the subsequent requests are different from the manifest request, so the query parameters should not be added.
  • SameOriginOnly same origin
    • useMPDUrlQuery="true" and sameOriginOnly="true" in the video AdaptationSet. The origins of the subsequent requests are the same as the manifest request, so the query parameters should be added.
  • AdaptationSet and Repressentation
    • AdaptationSet and Representation with different queryStrings for the same query parameter. Duplicate query parameters are not added; instead, the query parameters from the Representation are used where they are configured.

A sample page has been created to test all the listed manifests and view the requests made by the player. You can access it here:
Sample Page for URL Query Info Testing

@@ -1058,6 +1058,7 @@ function Settings() {
supportedEssentialProperties: [
{ schemeIdUri: Constants.FONT_DOWNLOAD_DVB_SCHEME },
{ schemeIdUri: Constants.COLOUR_PRIMARIES_SCHEME_ID_URI, value: /1|5|6|7/ },
{ schemeIdUri: Constants.URL_QUERY_INFO_SCHEME },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this to the JSDoc description. see line 77 - 81

const queryTemplate = essentialProperty?.ExtUrlQueryInfo?.queryTemplate || essentialProperty?.UrlQueryInfo?.queryTemplate || '';

const initialQueryParams = buildInitialQueryParams(initialQueryString);
if (queryTemplate === '$querypart$') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put $querypart$ in DashConstants

@@ -89,6 +91,7 @@ function HTTPLoader(cfg) {
cmsdModel = CmsdModel(context).getInstance();
customParametersModel = CustomParametersModel(context).getInstance();
commonAccessTokenController = CommonAccessTokenController(context).getInstance();
extUrlQueryInfoController = ExtUrlQueryInfoController(context).getInstance();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the possibility to use dependency injection here instead of instantiation. Inject the singleton instance of extUrlQueryInfoController in the setConfig function, similar to what is done for commonAccessTokenController. This allows easier unit testing later if required.

mpd;


function generateQueryParams(resultObject, manifestObejc, propertyString, mpdUrlQuery, defaultInitialString) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Private function use underscore syntax: _generateQueryParams

});
}

function parseQueryParams(queryParamString) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Private function use underscore syntax

}
}
}
else if (request.type == 'MPD') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use types defined in HTTPRequest class and strong equality

}
else if (request.type == 'MPD') {
if (mpd) {
const inRequest = ['mpd', 'mpdpatch'].some(r => mpd.includeInRequests.includes(r));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These types should also go in DashConstants


function ExtUrlQueryInfoController() {
let instance,
mpd;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename mpd to something more descriptive like mpdQueryStringInformation or sth like that

mpd.finalQueryString = '';
const mpdUrlQuery = manifest.url.split('?')[1];

generateQueryParams(mpd, manifest, 'SupplementalProperty', mpdUrlQuery, '');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand this function. The EssentialProperty descriptor can also be present at MPD level from my understanding. In addition, the SupplementalProperty descriptor can be present on AdaptationSet and Representation level.

From the 23009-1:

As defined by this specification, each of these descriptors may be present at the MPD, Adaptation Set or at the Representation level. Only SupplementalProperty descriptor may be present at the Period level.

mpd;


function generateQueryParams(resultObject, manifestObejc, propertyString, mpdUrlQuery, defaultInitialString) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo manifestObejc

@dsilhavy
Copy link
Collaborator

@JoaquinBCh : Thanks for the PR i added my review. In addition:

  • IncludeInRequests mpd mpdpatch does not seem to work correctly. I see query parameters being appended to media segment requests
  • @ZmGorynych: The reference content uses urn:mpeg:dash:urlparam:2014 instead of urn:mpeg:dash:schema:urlparam:2016 for up:ExtUrlQueryInfo. This does not seem to be specification compliant. @JoaquinBCh The urn:mpeg:dash:schema:urlparam:2016 needs to be added to the implementation as well.

@dsilhavy
Copy link
Collaborator

One more thing: Please add the sample page you implemented to the sample section in the advanced category: https://reference.dashif.org/dash.js/nightly/samples/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants