Let's assume we have an encrypted stream (SmoothStreaming + Playready) and a custom receiver build on googlecast/cast-custom-receiver.
I can see that device tries to get the license from the LA_URL (license acquisition URL) - extracted from stream PlayReady ProtectionHeader.
I wonder is there a way to override this behaviour? I want receiver to delegate license acquisition to sender - iOS app in my case.
You can achieve this by modifying the Media Player Library. The only thing that needs to be done - exposing challenge, key system, init data & sessionId though
prepareLicenseRequest()
.Please verify the variable names cause they can be different (they can be found in
webkitAddKey()
call later in the media_player.js code).In your receiver just define the your own
prepareLicenseRequest
implementation:When license acquired by sender it can send it back via the same channel. In this case receiver needs to add the license to the env:
window.messageBus
in this case is a custom channel (urn:x-cast:me.trnl.cast.key
)That's it. It works for us and it's quite fast.
When you are setting up a Host, you can pass a licenseUrl (see here), I think if that is present, it will be used for license acquisition.