|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.adobe.ave.drm.DRMManager
public class DRMManager
The DRMManager manages the retrieval and storage of the licenses needed to view DRM-protected content.
With the static DRMManager.getDRMManager() method, you can access the existing DRMManager object to perform the following DRM-management tasks:
| Field Summary | |
|---|---|
protected long |
peerObject
|
| Method Summary | |
|---|---|
void |
acquireLicense(DRMMetadata contentData,
DRMAcquireLicenseSettings setting,
DRMOperationErrorCallback error,
DRMLicenseAcquiredCallback acquired)
Loads a license from a media rights server or the local license cache. |
void |
acquirePreviewLicense(DRMMetadata contentData,
DRMOperationErrorCallback error,
DRMLicenseAcquiredCallback acquired)
Gets a preview license from the license server, which you can use to let a user verify that they can play content on particular computer. |
void |
authenticate(DRMMetadata metadata,
java.lang.String url,
java.lang.String authenticationDomain,
java.lang.String user,
java.lang.String password,
DRMOperationErrorCallback error,
DRMAuthenticationCompleteCallback complete)
Authenticates a user. |
DRMMetadata |
createMetadataFromBytes(byte[] bytes,
DRMOperationErrorCallback error)
|
long |
getMaxOperationTime()
|
static DRMManager |
getSharedManager(Context context)
Returns the singleton DRMManager instance |
void |
initialize(DRMOperationErrorCallback error,
DRMOperationCompleteCallback complete)
Precomputes anything that can be precomputed so that future playback will have the shortest delay possible. |
void |
joinLicenseDomain(DRMLicenseDomain licenseDomain,
boolean forceRefresh,
DRMOperationErrorCallback error,
DRMOperationCompleteCallback complete)
|
void |
leaveLicenseDomain(DRMLicenseDomain licenseDomain,
DRMOperationErrorCallback error,
DRMOperationCompleteCallback complete)
|
void |
resetDRM(DRMOperationErrorCallback error,
DRMOperationCompleteCallback complete)
Deletes all locally cached digital rights management (DRM) license data. |
void |
returnLicense(java.lang.String serverURL,
java.lang.String licenseID,
java.lang.String policyID,
boolean commitImmediately,
DRMOperationErrorCallback error,
DRMLicenseReturnCompleteCallback complete)
Returns the policies associated with a licenseID or a policy of a particular licenseID |
void |
setAuthenticationToken(DRMMetadata metadata,
java.lang.String authenticationDomain,
byte[] token,
DRMOperationErrorCallback error,
DRMOperationCompleteCallback complete)
Sets the authentication token to use for communication with the specified server and domain. |
void |
setMaxOperationTime(long maxOperationTime)
|
void |
setMaxOperationTimeNative(long maxOperationTime)
|
void |
storeLicenseBytes(byte[] licenseBytes,
DRMOperationErrorCallback error,
DRMOperationCompleteCallback complete)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long peerObject
| Method Detail |
|---|
public static DRMManager getSharedManager(Context context)
public void initialize(DRMOperationErrorCallback error,
DRMOperationCompleteCallback complete)
Call this method as early as possible in your application. Ideally, call this at a time that the user believes that the application is waiting for him (e.g. to pick what content to watch), so that he does not realize that he can't actually watch content yet because he would need to wait for the application.
public DRMMetadata createMetadataFromBytes(byte[] bytes,
DRMOperationErrorCallback error)
public long getMaxOperationTime()
public void setMaxOperationTime(long maxOperationTime)
public void setMaxOperationTimeNative(long maxOperationTime)
public void setAuthenticationToken(DRMMetadata metadata,
java.lang.String authenticationDomain,
byte[] token,
DRMOperationErrorCallback error,
DRMOperationCompleteCallback complete)
Setting a token overwrites any existing cached token for the server and domain. Set the token parameter to null to clear the cached token.
metadata - The metadata of the content (the URL of the authentication server will be found from this metadata)authenticationDomain - The domain on the media rights servertoken - The authentication token
public void authenticate(DRMMetadata metadata,
java.lang.String url,
java.lang.String authenticationDomain,
java.lang.String user,
java.lang.String password,
DRMOperationErrorCallback error,
DRMAuthenticationCompleteCallback complete)
Listen for the authenticationComplete and authenticationError events to determine the outcome of the authentication attempt. Multiple authenticate() calls are queued. The DRMAuthenticationCompleteCallback callback provided will be called with an authentication token that your application can save.
You can use a saved authentication token, or a token downloaded by another means, to establish an authenticated session with the media rights server in the future. To establish a session using a token, call the DRMManager setAuthenticationToken() method. The properties of the token, such as expiration date, are determined by the settings of the server that generates the token.
serverURL:String - The URL of a media rights server that can provide a voucher for viewing protected contentmetadata - the metadata of the contenturl - the url to the authentication serverauthenticationDomain - A domain on the server (not a network or Internet domain name)user - the user namepassword - the user's password
public void acquirePreviewLicense(DRMMetadata contentData,
DRMOperationErrorCallback error,
DRMLicenseAcquiredCallback acquired)
Like acquireLicense(), this method is an asynchronous call and calls the DRMLicenseAcquiredCallback on completion or a DRMOperationErrorCallback in case of errors.
public void acquireLicense(DRMMetadata contentData,
DRMAcquireLicenseSettings setting,
DRMOperationErrorCallback error,
DRMLicenseAcquiredCallback acquired)
The license is loaded according to the setting parameter:
If a license cannot be loaded from the media rights server, the DRMOperationErrorCallback is dispatched. The errorID property of the dispatched DRMErrorEvent object indicates the reason for the failure. Common causes of failure include attempting to connect to the media rights server when the user is offline and attempting to load a license when the user is not logged in. Your application can respond to these errors and take corrective action. For example, if authentication credentials are required to download the license, you can prompt the user for their account user name and password, call the DRMManager authenticate() method, and then attempt to load the license again.
If a license cannot be obtained from the local cache and the localOnly setting is used, the DRMOperationErrorCallback is not called. Instead, the DRMLicenseAcquiredCallback is called, but the license is null.
contentData - The DRMMetadata object from a DRM-protected media filesetting - Determines whether the license is retrieved from the local cache or the media rights server
public void storeLicenseBytes(byte[] licenseBytes,
DRMOperationErrorCallback error,
DRMOperationCompleteCallback complete)
public void resetDRM(DRMOperationErrorCallback error,
DRMOperationCompleteCallback complete)
The application must download the required licenses again for the user to be able to access encrypted content.
public void returnLicense(java.lang.String serverURL,
java.lang.String licenseID,
java.lang.String policyID,
boolean commitImmediately,
DRMOperationErrorCallback error,
DRMLicenseReturnCompleteCallback complete)
serverURL - URL to the license server to which licenses will be returnedlicenseID - Licenses matching this licenseID will be returned.policyID - If not null, only licenses matching this policyID will be returnedcommitImmediately - False denotes the license should be marked as returned regardless of response from license server
public void joinLicenseDomain(DRMLicenseDomain licenseDomain,
boolean forceRefresh,
DRMOperationErrorCallback error,
DRMOperationCompleteCallback complete)
public void leaveLicenseDomain(DRMLicenseDomain licenseDomain,
DRMOperationErrorCallback error,
DRMOperationCompleteCallback complete)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||