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

"Media failed to decode error" after a few playbacks on macOS #7629

Open
lepinese opened this issue Nov 19, 2024 · 3 comments
Open

"Media failed to decode error" after a few playbacks on macOS #7629

lepinese opened this issue Nov 19, 2024 · 3 comments
Labels
component: FairPlay The issue involves the FairPlay DRM component: HLS The issue involves Apple's HLS manifest format type: bug Something isn't working correctly
Milestone

Comments

@lepinese
Copy link

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

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

Yes

What version of Shaka Player are you using?

4.9.8

Are you using the demo app or your own custom app?
Custom app

If custom app, can you reproduce the issue using our demo app?
Haven't been able to make the custom demo app work at all, the License call fails with a HTTP Status 412 – Precondition Failed.
But the Big Buck Bunny (FairPlay) demo works fine.

What browser and OS are you using?
Safari : 17.2.1
macOS : Sonoma 14.2.1

What are the manifest and license server URIs?

We are using DRMToday

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

"{
  \"drm\": {
    \"retryParameters\": {
      \"baseDelay\": 100
    },
    \"servers\": {
      \"com.apple.fps\": \"https://lic.drmtoday.com/license-server-fairplay/\"
    },
    \"advanced\": {
      \"com.apple.fps\": {
        \"distinctiveIdentifierRequired\": false,
        \"persistentStateRequired\": false,
        \"videoRobustness\": \"\",
        \"audioRobustness\": \"\",
        \"sessionType\": \"\",
        \"serverCertificate\": {
           ** The certificate **
        },
        \"serverCertificateUri\": \"\",
        \"individualizationServer\": \"\"
      }
    }
  },
  \"manifest\": {
    \"retryParameters\": {
      \"baseDelay\": 100
    },
    \"availabilityWindowOverride\": null,
    \"dash\": {
      \"autoCorrectDrift\": false,
      \"ignoreSuggestedPresentationDelay\": true
    }
  },
  \"streaming\": {
    \"retryParameters\": {
      \"baseDelay\": 100
    },
    \"rebufferingGoal\": 0.01,
    \"inaccurateManifestTolerance\": 0,
    \"lowLatencyMode\": true,
    \"updateIntervalSeconds\": 0.1,
    \"maxDisabledTime\": 1,
    \"segmentPrefetchLimit\": 2
  },
  \"mediaSource\": {},
  \"offline\": {}
}"

What did you do?

The first few playbacks of the media work normally but then at some point (could be 1, 10 or more playbacks) we keep getting the "Media failed to decode" error and it stops working.

I found this issue which looks similar but was closed to inactivity : #4852

Just like this issue, when restarting Safari it works again.

When it fails, our license calls are still working normally. When looking at the debug console there doesn't seem to be any relevant information about what's going wrong.

Screenshot 2024-11-19 at 11 50 39

Here's a bit of code :

this.player.getNetworkingEngine().registerRequestFilter(function(type, request) {
    if (type === shaka.net.NetworkingEngine.RequestType.LICENSE) {
        request.headers['X-Dt-Auth-Token'] = fairplayAuthToken;
    }
});
this.player.getNetworkingEngine().registerResponseFilter(function(type, response) {
    if (type === shaka.net.NetworkingEngine.RequestType.LICENSE) {
        const responseText = shaka.util.StringUtils.fromUTF8(response.data);
        response.data = shaka.util.Uint8ArrayUtils.fromBase64(responseText).buffer;
    }
});
this.player.configure({
    drm: servers: {
        'com.apple.fps': fairplayLicenseUrl)
    },
    advanced: {
        'com.apple.fps': {
            serverCertificate: new Uint8Array(fairplayCertificate)
        }
    manifest: {
        hls: {
            allowLowLatencyByteRangeOptimization: true
        }
    }
});

What did you expect to happen?
The media to work all the time

@lepinese lepinese added the type: bug Something isn't working correctly label Nov 19, 2024
@shaka-bot shaka-bot added this to the v4.13 milestone Nov 19, 2024
@lepinese lepinese changed the title "Media failed to decode error" after a few playback on macOS "Media failed to decode error" after a few playbacks on macOS Nov 19, 2024
@avelad avelad added component: HLS The issue involves Apple's HLS manifest format component: FairPlay The issue involves the FairPlay DRM labels Nov 26, 2024
@ProtoScott
Copy link

Is there any movement on this ticket? I've sent through info on #7664

@avelad
Copy link
Member

avelad commented Nov 27, 2024

I have been able to reproduce the bug, but I have not had time to work on it.

@ProtoScott
Copy link

@avelad Have you had a chance to look further into the issue? Is there anything we can do to help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: FairPlay The issue involves the FairPlay DRM component: HLS The issue involves Apple's HLS manifest format type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

4 participants