shaka-player: Couldn't get initDataTransform working for Fairplay
Hi,
I’try to use FairPlay in Shaka, and right now I’m not able to get it working when it comes to initDataTransform method. I’ve following piece of code (only interesting part):
player.configure('drm.initDataTransform', (initData) => {
const processedData = String.fromCharCode.apply(null, new Uint16Array(initData.buffer)).substring(1);
const contentId = new URL(processedData.substring(1)).hostname;
const cert = player.drmInfo().serverCertificate;
serverProcessSPCPath = processedData.substring(1).replace('skd://', 'https://');
return shaka.util.FairPlayUtils.initDataTransform(initData, contentId, cert);
});
player.configure({
drm: {
servers: {
'com.apple.fps.1_0': licenseServerUrl
},
advanced: {
'com.apple.fps.1_0': {
serverCertificate: new Uint8Array(cert),
},
},
},
});
When I try to play something then I’m receiving error 6015. Actually I’m able to assign result of this method to variable and see, the result but in general Shaka throws error which points to this method. I’ve also investigated values from all variables and everything looks just fine.
Any suggestions, what might be wrong?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (7 by maintainers)
@victordidenko Actually right now I’m not using shaka for Fairplay… I’m using standard approach (No additional libraries) which works like a charm.