Class DrmConfig
How a StreamRequest obtains the keys of a protected stream: the scheme, the
license server URL, and whatever that server needs to authorize the request.
The license exchange is made by the platform player, or by the port on the player's behalf. The request body is the opaque challenge the scheme defines and the response goes back to the player unread, so the license server is the only party that interprets either:
String playbackToken = "token-from-your-server";
DrmConfig drm = new DrmConfig(DrmScheme.WIDEVINE, "https://example.com/license/widevine")
.addLicenseHeader("Authorization", "Bearer " + playbackToken);
DrmScheme.AES_128 needs no license URL: the key URL is in the playlist, and any
token it needs belongs in that URL.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLicenseHeader(String name, String value) Adds an HTTP header sent with every license request, typically the authorization the license server checks the viewer's entitlement with.The FairPlay application certificate URL.The FairPlay content identifier.The headers sent with every license request.Where the player posts its license challenge.The protection scheme.setCertificateUrl(String certificateUrl) Sets the URL of the FairPlay application certificate, the DER file Apple issues to the content owner.setContentId(String contentId) Sets the FairPlay content identifier passed to the key request.
-
Constructor Details
-
DrmConfig
Creates a configuration for the given scheme.
Parameters
-
scheme: the protection scheme the stream is packaged with -
licenseUrl: where the player posts its license challenge; may be null only forDrmScheme.AES_128, whose key URL is part of the playlist
-
-
-
Method Details
-
getScheme
The protection scheme.
Returns
the scheme this configuration was created with
-
getLicenseUrl
Where the player posts its license challenge.
Returns
the license URL, or null for
DrmScheme.AES_128 -
setCertificateUrl
Sets the URL of the FairPlay application certificate, the DER file Apple issues to the content owner. Required for
DrmScheme.FAIRPLAYand ignored by every other scheme.Parameters
certificateUrl: the certificate URL
Returns
this configuration, for chaining
-
getCertificateUrl
The FairPlay application certificate URL.
Returns
the certificate URL, or null when none was set
-
setContentId
Sets the FairPlay content identifier passed to the key request. When none is set, the host of the
skd://key URL in the playlist is used, which is the common convention.Parameters
contentId: the content identifier
Returns
this configuration, for chaining
-
getContentId
The FairPlay content identifier.
Returns
the content identifier, or null to derive it from the key URL
-
addLicenseHeader
-
getLicenseHeaders
-