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

ContentSteering promise is resolved too late for fetching of dash initialisation segment #8123

Closed
gmcgarry opened this issue Feb 20, 2025 · 0 comments · Fixed by #8126
Closed
Assignees
Labels
component: DASH The issue involves the MPEG DASH manifest format priority: P2 Smaller impact or easy workaround type: bug Something isn't working correctly
Milestone

Comments

@gmcgarry
Copy link
Contributor

gmcgarry commented Feb 20, 2025

Have you read the FAQ and checked for duplicate open issues?
Yes.

If the problem is related to FairPlay, have you read the tutorial?

No

What version of Shaka Player are you using?

Git Commit SHA: d5eab12

Can you reproduce the issue with our latest release version?
YEs.

Can you reproduce the issue with the latest code from main?
Yes.

Are you using the demo app or your own custom app?
Demo App.

If custom app, can you reproduce the issue using our demo app?
Yes.

What browser and OS are you using?
Safari on MacOS, Chrome on WIndows11

For embedded devices (smart TVs, etc.), what model and firmware version are you using?

What are the manifest and license server URIs?

https://chromium.dolby.link/content_steering/manifest.mpd

What configuration are you using? What is the output of player.getNonDefaultConfiguration()?

{
    \"drm\": {
        \"advanced\": {
            \"com.widevine.alpha\": {
                \"distinctiveIdentifierRequired\": false,
                \"persistentStateRequired\": false,
                \"sessionType\": \"\",
                \"serverCertificateUri\": \"\",
                \"individualizationServer\": \"\"
            },
            \"com.microsoft.playready\": {
                \"distinctiveIdentifierRequired\": false,
                \"persistentStateRequired\": false,
                \"sessionType\": \"\",
                \"serverCertificateUri\": \"\",
                \"individualizationServer\": \"\"
            },
            \"com.microsoft.playready.recommendation\": {
                \"distinctiveIdentifierRequired\": false,
                \"persistentStateRequired\": false,
                \"sessionType\": \"\",
                \"serverCertificateUri\": \"\",
                \"individualizationServer\": \"\"
            },
            \"com.apple.fps\": {
                \"distinctiveIdentifierRequired\": false,
                \"persistentStateRequired\": false,
                \"sessionType\": \"\",
                \"serverCertificateUri\": \"https://ott.dolby.com/OnDelKits/fairplay.cer\",
                \"individualizationServer\": \"\"
            },
            \"org.w3.clearkey\": {
                \"distinctiveIdentifierRequired\": false,
                \"persistentStateRequired\": false,
                \"sessionType\": \"\",
                \"serverCertificateUri\": \"\",
                \"individualizationServer\": \"\"
            }
        },
        \"keySystemsMapping\": {
            \"com.microsoft.playready\": \"com.microsoft.playready.recommendation\"
        }
    },
    \"preferredAudioLanguage\": \"en-AU\",
    \"preferredTextLanguage\": \"en-AU\",
    \"preferredVideoCodecs\": [
        \"dvh1\",
        \"dvhe\"
    ]
}

What did you do?

https://shaka-player-demo.appspot.com/demo/#audiolang=en-AU;textlang=en-AU;uilang=en-AU;assetBase64=eyJuYW1lIjoiIiwic2hvcnROYW1lIjoiIiwiaWNvblVyaSI6IiIsIm1hbmlmZXN0VXJpIjoiaHR0cHM6Ly9jaHJvbWl1bS5kb2xieS5saW5rL2NvbnRlbnRfc3RlZXJpbmcvbWFuaWZlc3QubXBkIiwic291cmNlIjoiQ3VzdG9tIiwiZm9jdXMiOmZhbHNlLCJkaXNhYmxlZCI6ZmFsc2UsImV4dHJhVGV4dCI6W10sImV4dHJhVGh1bWJuYWlsIjpbXSwiZXh0cmFDaGFwdGVyIjpbXSwiY2VydGlmaWNhdGVVcmkiOm51bGwsImRlc2NyaXB0aW9uIjpudWxsLCJpc0ZlYXR1cmVkIjpmYWxzZSwiZHJtIjpbIk5vIERSTSBwcm90ZWN0aW9uIl0sImZlYXR1cmVzIjpbIlZPRCJdLCJsaWNlbnNlU2VydmVycyI6eyJfX3R5cGVfXyI6Im1hcCJ9LCJvZmZsaW5lTGljZW5zZVNlcnZlcnMiOnsiX190eXBlX18iOiJtYXAifSwibGljZW5zZVJlcXVlc3RIZWFkZXJzIjp7Il9fdHlwZV9fIjoibWFwIn0sInJlcXVlc3RGaWx0ZXIiOm51bGwsInJlc3BvbnNlRmlsdGVyIjpudWxsLCJjbGVhcktleXMiOnsiX190eXBlX18iOiJtYXAifSwiZXh0cmFDb25maWciOm51bGwsImV4dHJhVWlDb25maWciOm51bGwsImFkVGFnVXJpIjpudWxsLCJpbWFWaWRlb0lkIjpudWxsLCJpbWFBc3NldEtleSI6bnVsbCwiaW1hQ29udGVudFNyY0lkIjpudWxsLCJpbWFNYW5pZmVzdFR5cGUiOm51bGwsIm1lZGlhVGFpbG9yVXJsIjpudWxsLCJtZWRpYVRhaWxvckFkc1BhcmFtcyI6bnVsbCwidXNlSU1BIjp0cnVlLCJtaW1lVHlwZSI6bnVsbH0=;panel=HOME;build=uncompiled

What did you expect to happen?
This manifest contains a ContentSteering element with an out-of-service defaultServiceLocation, but also contains queryBeforeStart=true. The expected behaviour is that the player will fetch the content-steering response and update the list of service locations and priorities before attempting to fetch the initialisation segment.

What actually happened?

The segment uris for the initialisation segment is constructed before the promise to fetch the content-steering response is resolved. So the initialisation segment is fetched from the out-of-service default service location.
Additionally, timed-out fetches are not causing re-tries on the updated service locations. To be fair, failover may work if the fetches of the initialisation segment received 4xx responses rather than no response. I didn't check.

Are you planning to send a PR to fix it?

The solution is to resolve contentSteeringPromise before passing getBaseUris to DashParser.parsePeriods_().

diff --git a/lib/dash/dash_parser.js b/lib/dash/dash_parser.js
index 66443c343..e92ed2300 100644
--- a/lib/dash/dash_parser.js
+++ b/lib/dash/dash_parser.js
@@ -771,6 +771,8 @@ shaka.dash.DashParser = class {
       urlParams: () => '',
     };
 
+    await contentSteeringPromise;
+
     this.gapCount_ = 0;
     const periodsAndDuration = this.parsePeriods_(
         context, getBaseUris, mpd, /* newPeriod= */ false);
@@ -794,8 +796,6 @@ shaka.dash.DashParser = class {
       presentationTimeline.assertIsValid();
     }
 
-    await contentSteeringPromise;
-
     if (this.isLowLatency_ && this.lowLatencyMode_) {
       const presentationDelay = suggestedPresentationDelay != null ?
           suggestedPresentationDelay : this.config_.defaultPresentationDelay;
@gmcgarry gmcgarry added the type: bug Something isn't working correctly label Feb 20, 2025
@shaka-bot shaka-bot added this to the v4.14 milestone Feb 20, 2025
@avelad avelad added priority: P2 Smaller impact or easy workaround component: DASH The issue involves the MPEG DASH manifest format labels Feb 20, 2025
@avelad avelad self-assigned this Feb 20, 2025
avelad added a commit that referenced this issue Feb 20, 2025
avelad added a commit that referenced this issue Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: DASH The issue involves the MPEG DASH manifest format priority: P2 Smaller impact or easy workaround type: bug Something isn't working correctly
Projects
None yet
3 participants