getLicenseChallenge

open suspend override fun getLicenseChallenge(sessionId: ByteString, pssh: PSSH, licenseType: LicenseType, privacyMode: Boolean, requestType: LicenseRequest.RequestType): ByteArray

Build and sign a Widevine license request for the provided pssh. Stores internal request context needed to later parseLicense for this session.

Return

the serialized SignedMessage(LICENSE_REQUEST)

Parameters

sessionId

session id from open

pssh

parsed or raw init data holder

licenseType

type of license to request (e.g., STREAMING)

privacyMode

if true and a service certificate is set, send encrypted client id

requestType

NEW for a first request; RENEWAL or RELEASE reference the license already parsed for this session rather than the content

Throws

if the session id is invalid

if pssh init data is empty

if a RENEWAL or RELEASE is requested before a license has been parsed for this session

if a RENEWAL is requested but the policy forbids it