Closed MaazF94 closed 3 years ago
First, could you please share a code snippet on how you managed to do it on Widevine? I'm experiencing issues with that, and would really appreciate some help.
Regarding your issue with Fairplay DRM, it looks like you're not using the prop getLicense
. I believe you should. That prop retrieves the spc
blob as a parameter, and then you make a request to the Fairplay License Server using that spc
blob (usually encoded in Base 64).
I've used this issue thread as reference: https://github.com/react-native-video/react-native-video/pull/2208
First, could you please share a code snippet on how you managed to do it on Widevine? I'm experiencing issues with that, and would really appreciate some help.
Regarding your issue with Fairplay DRM, it looks like you're not using the prop
getLicense
. I believe you should. That prop retrieves thespc
blob as a parameter, and then you make a request to the Fairplay License Server using thatspc
blob (usually encoded in Base 64).I've used this issue thread as reference: #2208
Oh maybe I misunderstood it then. I thought we didn't need to use getLicense. I'll have to do some testing and try it out. Thanks for the suggestion!
For Widevine, I have the exact same code from my original issue except without certificate URL and the source URI which I grabbed from AWS is DASH not HLS (ends with .mpd). The License Server URL is almost the same format except "fp" is replaced with "wv". And of course, it's generated from the ExpressPlay API so it's a different URL with a different token.
@sebastianpaz not sure if it made a difference. Now, I at least see that I'm hitting the right URL but, still getting a 403 response. Any idea why or where exactly I'm getting this 403 from?
` getLicense: async (spcString) => { const base64spc = base64.encode(spcString); return fetch( My_ExpressPlay_License_URL, { method: "POST", headers: { "Content-Type": "application/octet-stream", }, body: JSON.stringify({ getFairplayLicense: { spcMessage: base64spc, }, }), } ) .then((response) => response.json()) .then((response) => { if ( response && response.getFairplayLicenseResponse && response.getFairplayLicenseResponse.ckcResponse ) { return response.getFairplayLicenseResponse.ckcResponse; } throw new Error("No correct response"); }) .catch((error) => { console.error("CKC error", error); }); }
`
Hey sorry for the late response. Did you configure your FPS certificate on the Apple Developer website? https://developer.apple.com/streaming/fps/
EDIT: Regarding your code, it looks ok to me.
Hi, you were able to solve the issue? i have the same problem.
Yes, I got it working but I switched from expressplay to pallycon. No issues
Bug
I'm using ExpressPlay with AWS MediaPackage to generate my source URLs and license acquisition URLs (License Server). With Widevine, it's simple plug n play and no issues. With FairPlay, I'm receiving inconsistent errors and never able to play the video. I've confirmed that with my Source URL, License Server URL, and Certificate URL, I can play the video in the Shaka Player Demo. I've shared the URLs as examples in the reproducible code section below.
1. I receive the error "Error getting license from URL skd://${contentIdValue}" with HTTP Status Code 403 Forbidden. ExpressPlay doesn't do anything with the skd value, I've checked with them. The URL should be the License Server URL. Is there a way I can override this?
NSData *spcData = [loadingRequest streamingContentKeyRequestDataForApp:certificateData contentIdentifier:contentIdData options:nil error:&spcError];
Either way, the error is always the same.
Platform
iOS Which player are you experiencing the problem on:
Environment info
React native info output:
Library version: 5.1.1
Steps To Reproduce
Expected behaviour
Reproducible sample code
` const { width, height } = Dimensions.get("window");
<Video source={{ uri: "https://e36c169ad4441ce9fcc50154be8163b8.egress.mediapackage-vod.us-west-2.amazonaws.com/out/v1/9a5ab2b521d24c0b846786bfe3fbc801/98b66a37ba164e55a54b636401117163/657fccc6bc4842539073ce28e18f8442/index.m3u8", }} drm={{ type: "fairplay", certificateUrl: Use_Your_Valid_FPS_Cert, licenseServer: "https://fp.service.expressplay.com/hms/fp/rights/?ExpressPlayToken=BgAk0pGeKZkAJGVmODVmZWNlLTZhNTItNDJjMC05MDFlLTNjMWQyOWFkNGE2MgAAAGCZ2yBWoH2xecLidmf87OHmoiVDeJk3O0s_1jJdW-dYrnzj8PufJy7xFyFgD1pnBZJzTlYA3BmLOYixh8yeYXIU52AuJLMrFbNY9LRpyBcSQ1jSdff802ORE20g-p727GI5_fyLa4xj08V0vLH0NT1sG5SEGA", headers: { "content-type": "application/octet-stream", }, }} style={{ width: width, height: height }} resizeMode="contain" rate={1.0} volume={1.0} /> `
Video sample
included in code sample above