I've created a custom receiver app for some DRM-enabled videos on an Azure Media Server, but I have to get a bearer token first. Which I do, and I have sent as customData in the sender request. I've also created a class to process the MPEG-DASH Manifest and get the License Acquisition URL. Here is what I have, in part.
/** variable declaration, for
* CastReceiverContext, PlaybackConfig, PlayerManager, etc....
*/
playerManager.setMediaPlaybackInfoHandler((loadRequest, playbackConfig) => {
if (loadRequest.media.customData && loadRequest.media.customData.bearerToken {
bearerToken = loadRequest.media.customData.bearerToken;
}
});
playbackConfig.manifestHandler = (manifestString) => {
const mh = DashManifestParser(manifestString);
const licenseUrl = mh.licenseAcquisitionUrl();
if (licenseUrl) {
playbackConfig.licenseUrl = licenseUrl;
}
};
playbackConfig.licenseRequestHandler = (request) => {
console.log("I AM REQUESTING THE LICENSE NOW. WATCH THIS. NO, REALLY!");
};
How do I get this to be processed as part of the DRM request? I can't actually find the right place to inject the bearer token into the license acquisition URL. I understand that at this point, I need to send a request to https://thestacks.keydelivery.eastus.media.azure.net/Widevine/?kid=28ab28d4-ecca-fake-ckid-801ba72c1fe8 with the bearer token. I assume this is done by the receiver app automatically, but it's not. Even playbackConfig.licenseRequestHandler is never being called. I assume that even if my function fails to do what it's supposed to, I'd see an obnoxious log in the debugger -- but nothing shows up but an eventual error around 40s in: {"shakaErrorCode":6006,"shakaErrorData":["Generate request failed."]}