# new media/DRM()
Reimplementation of DRM Agent Extension.
This is to support loading of DRM Agent for XDK Player.
- Implements:
Members
String
# static playerUsingDRMAgent
ID of the player that is currently using a DRM agent. Kept outside of XDK Class definition to avoid it being reset.
Methods
# async createDRMAgent(drmType) → {Promise.<DRMAgent>}
Create a DRM agent instance for the type specified.
Parameters:
Name | Type | Description |
---|---|---|
drmType |
String
|
The DRM scheme, it should match the scheme defined in the config. |
Native Promise, wrapping a fresh instance of the specified DRM agent will be returned.
Promise.<DRMAgent>
# async prepare(player) → {Promise.<void>}
Record the player ID that are going to prepare a DRM agent.
Unlike AudioTrack and Subtitle extension management module, calling DRM prepare does not trigger the preparation of the DRM agent underneath. Instead, the caller of createDRMAgent, who obtains a fresh instance of the specified DRM agent, is responsible for calling the prepare function before using it.
Parameters:
Name | Type | Description |
---|---|---|
player |
Player
|
XDK Player instance. |
- Implements:
Native Promise.
Promise.<void>