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

HLS FAIRPLAY with DRM not working with v4.0.0 #4211

Closed
hiren3897 opened this issue May 11, 2022 · 51 comments
Closed

HLS FAIRPLAY with DRM not working with v4.0.0 #4211

hiren3897 opened this issue May 11, 2022 · 51 comments
Assignees
Labels
component: FairPlay The issue involves the FairPlay DRM component: HLS The issue involves Apple's HLS manifest format priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@hiren3897
Copy link

hiren3897 commented May 11, 2022

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

What version of Shaka Player are you using?
v4.0

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

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

What browser and OS are you using?
Safari iOS, iPad, MacOS

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

What are the manifest and license server URIs?

HLS FAIR PLAY with native as well as with MSE doesn't work

we have mp2t content type in HLS

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

drm.servers => drm_URL
drm.advanced.'com.apple.fps.1_0'.serverCertificate: cert

What did you do?

To play the HLS Fairplay live stream on the safari browser with DRM and ServerCertificate but it is not working in v4 :( I have a blank player playing nothing

What did you expect to happen?
To have an HLS LIVE playback on safari mac and iOS and iPad

What actually happened?

The HLS Fairplay used to work perfectly with v3.2.2 but it is not working in v4 :(

I will send the screenshot and whole debug on mail

@hiren3897 hiren3897 added the type: bug Something isn't working correctly label May 11, 2022
@hiren3897 hiren3897 changed the title HLS FAIRPLAY not working with v4.0.0 HLS FAIRPLAY with DRM not working with v4.0.0 May 11, 2022
@github-actions github-actions bot added this to the v4.1 milestone May 11, 2022
@avelad
Copy link
Collaborator

avelad commented May 11, 2022

Please use com.apple.fps see #3776

It is a change that has been introduced in 4.0.

@avelad avelad added the status: working as intended The behavior is intended; this is not a bug label May 11, 2022
@avelad avelad removed this from the v4.1 milestone May 11, 2022
@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label May 11, 2022
@github-actions github-actions bot added this to the v4.1 milestone May 11, 2022
@hiren3897
Copy link
Author

hiren3897 commented May 11, 2022

after changing it from com.apple.fps.1_0 to com.apple.fps still it doesn't work for me.

@github-actions github-actions bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label May 11, 2022
@hiren3897
Copy link
Author

hiren3897 commented May 11, 2022

I tested on the Shaka demo app and it says media failed to decode

@hiren3897
Copy link
Author

I have sent an email to shaka-player-issues@google.com with the template and the demo test URL. can you please test it on safari

Thanks

@hiren3897
Copy link
Author

hiren3897 commented May 12, 2022

Did you have time to see the URLs on the mail I sent?

Because of com.apple.fps see #3776
Do we have to change something on our DRM license and Apple FPS Certificate?

@hiren3897
Copy link
Author

Hello @avelad did you got time to test it? are you available?

@avelad
Copy link
Collaborator

avelad commented May 16, 2022

@hiren3897 Sorry, I'm on holidays until tomorrow

@hiren3897
Copy link
Author

Okay, once you are back on Wednesday please let me know.

@joeyparrish
Copy link
Member

@hiren3897, @avelad does not work at Google and does not have access to what you sent to shaka-player-issues. Do I have your permission to forward that message to him?

@hiren3897
Copy link
Author

@joeyparrish Yes!, you can forward it to him, I will send the new demo to test because the earlier URLs are expired

@avelad
Copy link
Collaborator

avelad commented May 17, 2022

@hiren3897 One question, I haven't received Joey's email yet because he's sleeping, what is the DRM provider (company)?

@hiren3897
Copy link
Author

The DRM provider Company is EZDRM: https://www.ezdrm.com

@avelad
Copy link
Collaborator

avelad commented May 17, 2022

Using: https://na-fps.ezdrm.com/demo/ezdrm/master.m3u8

and the next configuration:

{
  "drm": {
    "retryParameters": {
      "maxAttempts": 2,
      "baseDelay": 1000,
      "backoffFactor": 2,
      "fuzzFactor": 0.5,
      "timeout": 0,
      "stallTimeout": 5000,
      "connectionTimeout": 10000
    },
    "servers": {
      "com.apple.fps": "https://fps.ezdrm.com/api/licenses/b99ed9e5-c641-49d1-bfa8-43692b686ddb"
    },
    "clearKeys": {},
    "advanced": {
      "com.apple.fps": {
        "distinctiveIdentifierRequired": false,
        "persistentStateRequired": false,
        "videoRobustness": "",
        "audioRobustness": "",
        "sessionType": "",
        "serverCertificate": {},
        "serverCertificateUri": "https://fps.ezdrm.com/demo/video/eleisure.cer",
        "individualizationServer": ""
      }
    },
    "delayLicenseRequestUntilPlayed": false,
    "logLicenseExchange": false,
    "updateExpirationTime": 1,
    "preferredKeySystems": []
  },
  "manifest": {
    "retryParameters": {
      "maxAttempts": 2,
      "baseDelay": 1000,
      "backoffFactor": 1,
      "fuzzFactor": 0.5,
      "timeout": 15000,
      "stallTimeout": 2000,
      "connectionTimeout": 3000
    },
    "availabilityWindowOverride": null,
    "disableAudio": false,
    "disableVideo": false,
    "disableText": false,
    "disableThumbnails": true,
    "defaultPresentationDelay": 0,
    "segmentRelativeVttTiming": false,
    "dash": {
      "clockSyncUri": "",
      "ignoreDrmInfo": false,
      "disableXlinkProcessing": true,
      "xlinkFailGracefully": false,
      "ignoreMinBufferTime": true,
      "autoCorrectDrift": true,
      "initialSegmentLimit": 10000000000,
      "ignoreSuggestedPresentationDelay": false,
      "ignoreEmptyAdaptationSet": false,
      "ignoreMaxSegmentDuration": false,
      "keySystemsByURI": {
        "urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey",
        "urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e": "org.w3.clearkey",
        "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha",
        "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready",
        "urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95": "com.microsoft.playready",
        "urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb": "com.adobe.primetime"
      }
    },
    "hls": {
      "ignoreTextStreamFailures": true,
      "ignoreImageStreamFailures": false,
      "defaultAudioCodec": "mp4a.40.2",
      "defaultVideoCodec": "avc1.42E01E",
      "ignoreManifestProgramDateTime": false,
      "mediaPlaylistFullMimeType": "video/mp2t; codecs=\"avc1.42E01E, mp4a.40.2\""
    }
  },
  "streaming": {
    "retryParameters": {
      "maxAttempts": 15,
      "baseDelay": 1000,
      "backoffFactor": 1,
      "fuzzFactor": 0.5,
      "timeout": 30000,
      "stallTimeout": 5000,
      "connectionTimeout": 10000
    },
    "rebufferingGoal": 2,
    "bufferingGoal": 30,
    "bufferBehind": 5,
    "ignoreTextStreamFailures": true,
    "alwaysStreamText": false,
    "startAtSegmentBoundary": false,
    "gapDetectionThreshold": 0.5,
    "durationBackoff": 1,
    "forceTransmuxTS": false,
    "safeSeekOffset": 5,
    "stallEnabled": true,
    "stallThreshold": 1,
    "stallSkip": 0.1,
    "useNativeHlsOnSafari": true,
    "inaccurateManifestTolerance": 0,
    "lowLatencyMode": false,
    "autoLowLatencyMode": false,
    "forceHTTPS": false,
    "preferNativeHls": false,
    "updateIntervalSeconds": 1,
    "dispatchAllEmsgBoxes": false,
    "observeQualityChanges": false,
    "maxDisabledTime": 30
  },
  "offline": {
    "usePersistentLicense": true,
    "numberOfParallelDownloads": 5
  },
  "abr": {
    "enabled": true,
    "useNetworkInformation": true,
    "defaultBandwidthEstimate": 1000000,
    "switchInterval": 4,
    "bandwidthUpgradeTarget": 0.95,
    "bandwidthDowngradeTarget": 0.95,
    "restrictions": {
      "minWidth": 0,
      "maxWidth": null,
      "minHeight": 0,
      "maxHeight": null,
      "minPixels": 0,
      "maxPixels": null,
      "minFrameRate": 0,
      "maxFrameRate": null,
      "minBandwidth": 0,
      "maxBandwidth": null
    },
    "advanced": {
      "minTotalBytes": 64000,
      "minBytes": 20000,
      "fastHalfLife": 2,
      "slowHalfLife": 4
    }
  },
  "preferredAudioLanguage": "es",
  "preferredTextLanguage": "es",
  "preferredVariantRole": "main",
  "preferredTextRole": "",
  "preferredAudioChannelCount": 2,
  "preferredVideoCodecs": [
    "dvh1",
    "dvhe",
    "av01",
    "hvc1",
    "hev1",
    "vp09",
    "vp9",
    "avc1",
    "avc3"
  ],
  "preferredAudioCodecs": [],
  "preferForcedSubs": false,
  "preferredDecodingAttributes": [],
  "restrictions": {
    "minWidth": 0,
    "maxWidth": null,
    "minHeight": 0,
    "maxHeight": null,
    "minPixels": 0,
    "maxPixels": null,
    "minFrameRate": 0,
    "maxFrameRate": null,
    "minBandwidth": 0,
    "maxBandwidth": null
  },
  "playRangeStart": 0,
  "playRangeEnd": null,
  "cmcd": {
    "enabled": false,
    "sessionId": "",
    "contentId": "",
    "useHeaders": false
  }
}

And the next request filter:

function ezdrmFairPlayRequest (type, request) {
  if (type !== shaka.net.NetworkingEngine.RequestType.LICENSE) {
    return;
  }
  request.headers['Content-Type'] = 'application/octet-stream';
}

and the next response filter
shaka.util.FairPlayUtils.commonFairPlayResponse

With this it works correctly in 4.0.0.

EZDRM data has been recolected from https://www.ezdrm.com/demonstration-of-shaka-player-security-ezdrm?hsLang=en

@avelad avelad removed this from the v4.1 milestone May 17, 2022
@avelad avelad removed the type: bug Something isn't working correctly label May 17, 2022
@avelad
Copy link
Collaborator

avelad commented May 17, 2022

Grabacion.de.pantalla.2022-05-17.a.las.14.19.07.mov

Note: there are no video and audio due DRM restrictions in the recording.

IMG_4402

@hiren3897
Copy link
Author

How did it appear in the second image?

It is only because of the DRM? so I have to ask the DRM about the problem we are facing?

@avelad
Copy link
Collaborator

avelad commented May 17, 2022

I haven't done anything special, I just opened your link...

@avelad
Copy link
Collaborator

avelad commented May 17, 2022

Note: I tested your url in iOS 15.5 (iPhone 13) and it works!

@hiren3897
Copy link
Author

Yes, I saw that already, it is weird maybe it is because of DRM not sure

but if I see on safari networks I have a correct license request with 200 OK

@avelad avelad self-assigned this May 17, 2022
@hiren3897
Copy link
Author

@avelad my HLS Fairplay stream still doesn't work with v4.0.1

@avelad
Copy link
Collaborator

avelad commented Jun 7, 2022

@hiren3897
Copy link
Author

That's strange it doesn't work on my mac mini safari :/

Do I have to implement this in my code?

player.getNetworkingEngine()
    .registerRequestFilter(FairPlayUtils.ezdrmFairPlayRequest);

@avelad
Copy link
Collaborator

avelad commented Jun 7, 2022

I would say yes, but the only thing is that it is in a PR that has not yet been merged, so it is not in any release yet.

@github-actions github-actions bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jun 7, 2022
@hiren3897
Copy link
Author

So in the current v4.0.1
It automatically does the initData when I configure the DRM license URL and Cert?
I am using com.fps.apple for configuring the the DRM licences and serverCertificate

@avelad
Copy link
Collaborator

avelad commented Jun 7, 2022

Since 4.0.1 you don't need to configure any initData transforms for EZDRM and you must use com.fps.apple.

@hiren3897
Copy link
Author

yes! I am doing the exact same as you told but strange no working.

for the server certificate I manually convert it into the Uint8Array and pass it to drm.com.apple.fps.serverCertificate
is it giving me the problem should I use directly the serverCertificateUri config?

@avelad
Copy link
Collaborator

avelad commented Jun 7, 2022

There shouldn't be any difference, but you can always try.

@hiren3897
Copy link
Author

hiren3897 commented Jun 7, 2022

I tried and it has the same result! doesn't work :/

Not even on iPhone Safari

Is there any setting we need to do in the safari browser for Fariplay?

@hiren3897
Copy link
Author

ima_6a7a7b5

@hiren3897
Copy link
Author

hiren3897 commented Jun 7, 2022

I tried to run it in debug mode and it gives me this in the console
ima_21d1133

Can you please tell me why does it fail to requestMediaKeySystemAccess then it fails to decode media capabilities

@hiren3897
Copy link
Author

Hello @avelad greetings of the day,

can you please comment on the above response? Thanks

@avelad
Copy link
Collaborator

avelad commented Jun 8, 2022

It seems that what fails in your capture is that some keysystems are being tested that are not supported in your browser. Widevine appears, PlayReady, Adobe?...

@hiren3897
Copy link
Author

Okay, But it should mainly test for the com.apple.fps no?
why does the player test other media capabilities?

Do we have any way to stop this test?

because it works with 3.2.2 on the same platform and browser

@avelad
Copy link
Collaborator

avelad commented Jun 8, 2022

The video that I have put in the comment above is with 4.1.0 and it works for me.

@hiren3897
Copy link
Author

hiren3897 commented Jun 8, 2022

The version is shaka v4.1.0

because I am still getting the error
ima_d483109

@avelad
Copy link
Collaborator

avelad commented Jun 8, 2022

Captura de pantalla 2022-06-08 a las 16 15 16
It seems that it is geoblocked for Madrid (Spain)

@hiren3897
Copy link
Author

hiren3897 commented Jun 8, 2022

I am sorry that I forgot to check that.
But for the success.
since v4.1.0
do we have changed any configuration for HLS Fairplay?

What do I do?
I give the .m3u8 URL to the load
I configure the DRM license to drm.servers.com.apple.fps: "https://path/to/license"
I configure the serverCertificateUri to drm.advanced.com.apple.fps.serverCertificateUri: "https://path/to/cert"

Am I missing something to do like ??

function ezdrmFairPlayRequest (type, request) {
  if (type !== shaka.net.NetworkingEngine.RequestType.LICENSE) {
    return;
  }
  request.headers['Content-Type'] = 'application/octet-stream';
}

with com.apple.fps.1_0 => I don't see the error of unable to MediaCapabilities.decodeInfo()
but with com.apple.fps => it gives me the error as you can see in my latest image before

@hiren3897
Copy link
Author

It is strange but with com.apple.fps.1_0 and shaka v4.1.0 it worked :/

@hiren3897
Copy link
Author

when I set com.apple.fps it doesn't work for me or on other machines
if I set com.apple.fps.1_0 it is working but sometimes it gives me the same result of loading DRM restrictions

I guess the DRM license request OR Fairplay cert is taking too long to be requested
@avelad can you please comment

@avelad avelad added component: FairPlay The issue involves the FairPlay DRM and removed component: EME The issue involves the Encrypted Media Extensions web API labels Jun 13, 2022
@hiren3897
Copy link
Author

hello, @avelad can we come to a point do we have a fix in the newly released version?

and what are the steps to set up Fairplay live stream?

Thanks

@avelad
Copy link
Collaborator

avelad commented Jun 28, 2022

It will be resolved with #4309

@avelad avelad closed this as completed Aug 11, 2022
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Oct 10, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: FairPlay The issue involves the FairPlay DRM component: HLS The issue involves Apple's HLS manifest format priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

3 participants