DRM
MediaDRM to obtain the content keys for decrypting protected media streams.
Public Fields
TrackType
Type of track this DRM is used for.
public Track.Type TrackType { get; set; }
Type | Description |
---|---|
Track.Type | Media player track types. |
Public Methods
Session CreateSession
Creates a new session for the DRM with the provided track information.
public Session CreateSession(
Info trackInfo
)
Parameters
Type | Name | Description |
---|---|---|
Info | trackInfo | The provided track information to create the new session with. |
DRM
Provides initilization of the DRM class with the two given parameters.
public DRM(
MLMedia.Player mlPlayer,
Info trackDRMInfo
)
Parameters
Type | Name | Description |
---|---|---|
MLMedia.Player | mlPlayer | The media player this DRM is associated with. |
Info | trackInfo | The info from the media player track that this DRM is associated with. |
MLResult GetPropertyByteArray
CURRENTLY UNTESTED ON CAPI Read a DRM engine plugin byte array property value, given the property name.
public MLResult GetPropertyByteArray(
Property property,
out byte [] propertyValue
)
Parameters
Type | Name | Description |
---|---|---|
Property | property | |
out byte [] | propertyValue |
MLResult GetPropertyString
CURRENTLY UNTESTED ON CAPI Read a DRM engine plugin String property value, given the property name.
public MLResult GetPropertyString(
Property property,
out string propertyValue
)
Parameters
Type | Name | Description |
---|---|---|
Property | property | |
out string | propertyValue |
MLResult GetSecureStop
CURRENTLY UNTESTED ON CAPI Access secure stop by secure stop ID.
public MLResult GetSecureStop(
byte [] secureStopId,
out byte [] secureStop
)
Parameters
Type | Name | Description |
---|---|---|
byte [] | secureStopId | |
out byte [] | secureStop |
See: MLMediaDRMGetSecureStops()
MLResult GetSecureStops
CURRENTLY UNTESTED ON CAPI Access all secure stops. Secure Stop: A means of enforcing limits on the number of concurrent streams per subscriber across devices is provided via #SecureStop. This is achieved by securely monitoring the lifetime of sessions. Information from the server related to the current playback session is written to persistent storage on the device when each #MediaCrypto object is created. In the normal case, playback will be completed, the session destroyed and the Secure Stops will be queried. The app queries secure stops and forwards the secure stop message to the server which verifies the signature and notifies the server side database that the session destruction has been confirmed. The persisted record on the client is only removed after positive confirmation that the server received the message using releaseSecureStops().
public MLResult GetSecureStops(
out byte secureStops[][]
)
Parameters
Type | Name | Description |
---|---|---|
out byte | secureStops[][] |
MLResult IsCryptoSchemeSupported
CURRENTLY UNTESTED ON CAPI Query if the given scheme identified by its UUID is supported on this device. And whether the drm plugin is able to handle the media container format.
public MLResult IsCryptoSchemeSupported(
MagicLeapNativeBindings.MLUUID uuid,
string mime,
out bool isSupported
)
Parameters
Type | Name | Description |
---|---|---|
MagicLeapNativeBindings.MLUUID | uuid | |
string | mime | |
out bool | isSupported |
delegate void OnEventDelegate
Delegate for the any OnEvent event.
public delegate void OnEventDelegate(
DRM drm,
Event eventInfo
)
Parameters
Type | Name | Description |
---|---|---|
DRM | drm | MediaDRM to obtain the content keys for decrypting protected media streams. |
Event | eventInfo | MediaDRM event info associated with a session. |
delegate void OnExpirationUpdateDelegate
Delegate for the any OnExpirationUpdate event.
public delegate void OnExpirationUpdateDelegate(
DRM drm,
Expiration expirationInfo
)
Parameters
Type | Name | Description |
---|---|---|
DRM | drm | MediaDRM to obtain the content keys for decrypting protected media streams. |
Expiration | expirationInfo | MediaDRM expiration update info associated with a session. |
delegate void OnKeyStatusChangeDelegate
Delegate for the any OnKeyStatusChange event.
public delegate void OnKeyStatusChangeDelegate(
DRM drm,
KeyStatuses KeyStatuses
)
Parameters
Type | Name | Description |
---|---|---|
DRM | drm | MediaDRM to obtain the content keys for decrypting protected media streams. |
KeyStatuses | KeyStatuses | MediaDRM session keys status change info. |
MLResult ProvisionRequest
A provision request/response exchange occurs between the app and a provisioning server to retrieve a device certificate. If provisioning is required, the #EVENT_PROVISION_REQUIRED event will be sent to the event handler. MLMediaDRMGetProvisionRequest() is used to obtain the opaque provision request byte array that should be delivered to the provisioning server.
public MLResult ProvisionRequest(
out byte [] requestData,
out string defaultURL
)
Parameters
Type | Name | Description |
---|---|---|
out byte [] | requestData | |
out string | defaultURL |
MLResult ProvisionResponse
After a provision response is received by the app, it is provided to the DRM engine plugin using this method.
public MLResult ProvisionResponse(
byte [] responseData
)
Parameters
Type | Name | Description |
---|---|---|
byte [] | responseData |
MLResult ReleaseAllSecureStops
CURRENTLY UNTESTED ON CAPI Remove all the SecureStops.
public MLResult ReleaseAllSecureStops()
MLResult ReleaseSecureStops
CURRENTLY UNTESTED ON CAPI Process the SecureStop server response message. After authenticating the message, remove the SecureStops identified in the response.
public MLResult ReleaseSecureStops(
byte [] secureStops
)
Parameters
Type | Name | Description |
---|---|---|
byte [] | secureStops |
MLResult SetPropertyByteArray
CURRENTLY UNTESTED ON CAPI Set a DRM engine plugin byte array property value.
public MLResult SetPropertyByteArray(
Property property,
byte [] propertyValue
)
Parameters
Type | Name | Description |
---|---|---|
Property | property | |
byte [] | propertyValue |
MLResult SetPropertyString
CURRENTLY UNTESTED ON CAPI Set a DRM engine plugin String property value.
public MLResult SetPropertyString(
Property property,
string propertyValue
)
Parameters
Type | Name | Description |
---|---|---|
Property | property | |
string | propertyValue |
Public Events
OnEvent
Event used to listen for different drm events.
public OnEventDelegate OnEvent()
OnExpirationUpdate
Event used to listen for when there is an update in expiration.
public OnExpirationUpdateDelegate OnExpirationUpdate()
OnKeyStatusChange
Event used to listen for when a key's status has changed.
public OnKeyStatusChangeDelegate OnKeyStatusChange()
Public Enums
EventType
The type of DRM event.
Enumerator | Value | Description |
---|---|---|
ProvisionRequired | 1 | This event type indicates that the app needs to request a certificate from the provisioning server. The request message data is obtained using MLMediaDRMGetProvisionRequest(). |
KeyRequired | This event type indicates that the app needs to request keys from a license server. The request message data is obtained using MLMediaDRMGetKeyRequest(). | |
KeyExpired | This event type indicates that the licensed usage duration for keys in a session has expired. The keys are no longer valid. | |
VendorDefined | This event may indicate some specific vendor-defined condition, see your DRM provider documentation for details. | |
SessionReclaimed | This event indicates that a session opened by the app has been reclaimed by the resource manager. | |
ExpirationUpdate | This event is issued when a session expiration update occurs, to inform the app about the change in expiration time. | |
KeysChange | This event is issued when the keys in a session change status, such as when the license is renewed or expires. |
KeyStatus
Enumerator | Value | Description |
---|---|---|
Usable | 0 | |
Expired | ||
OutputNotAllowed | ||
Pending | ||
InternalError |
KeyType
Type of DRM key.
Enumerator | Value | Description |
---|---|---|
Streaming | 1 | This key request type specifies that the keys will be for online use, they will. not be saved to the device for subsequent use when the device is not connected to a network. |
Offline | This key request type specifies that the keys will be for offline use, they will be saved to the device for use when the device is not connected to a network. | |
Release | This key request type specifies that previously saved offline keys should be released. |
Property
Enumerator | Value | Description |
---|---|---|
Vendor | ||
Version | ||
Description | ||
Algorithms | ||
DeviceUniqueId |