Constructor
new ContentProtection()
A set of functions for parsing and interpreting Protection elements.
- Source:
Members
licenseUrlParsers_ :Map.<string, function(!Element)>
A map of key system name to license server url parser.
Type:
- Map.<string, function(!Element)>
- Source:
PLAYREADY_RECORD_TYPES :number
Enum for PlayReady record types.
Type:
- number
Properties:
Name | Value | Type | Description |
---|---|---|---|
RIGHTS_MANAGEMENT |
1 | number | |
RESERVED |
2 | number | |
EMBEDDED_LICENSE |
3 | number |
- Source:
Methods
convertElements_(elementsnon-null, keySystemsBySystemIdnon-null) → {Array.<shaka.extern.DrmInfo>}
Creates DrmInfo objects from an array of elements.
Parameters:
Name | Type | Description |
---|---|---|
elements |
Array.<!Element> | |
keySystemsBySystemId |
Object.<string, string> |
- Source:
Returns:
- Type
- Array.<shaka.extern.DrmInfo>
getInitDataFromPro_(elementnon-null, systemID, keyIdnullable) → {Array.<shaka.extern.InitDataOverride>}
Gets a initData from a protection element.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
element |
Element | ||
systemID |
string | ||
keyId |
string |
<nullable> |
- Source:
Returns:
- Type
- Array.<shaka.extern.InitDataOverride>
getKID_(xmlnon-null) → {string}
Parse a PlayReady Header format: https://goo.gl/dBzxNA
a try to find the KID value.
Parameters:
Name | Type | Description |
---|---|---|
xml |
Element |
- Source:
Returns:
- Type
- string
getLaurl_(xmlnon-null) → {string}
Parse a PlayReady Header format: https://goo.gl/dBzxNA
a try to find the LA_URL value.
Parameters:
Name | Type | Description |
---|---|---|
xml |
Element |
- Source:
Returns:
- Type
- string
getPlayReadyHeaderObject_(elementnon-null) → {Element}
Gets a PlayReady Header Object from a protection element
Parameters:
Name | Type | Description |
---|---|---|
element |
Element |
- Source:
Returns:
- Type
- Element
getPlayReadyKID_(elementnon-null) → {string}
Gets a PlayReady KID from a protection element
containing a PlayReady Header Object
Parameters:
Name | Type | Description |
---|---|---|
element |
Element |
- Source:
Returns:
- Type
- string
getPlayReadyLicenseUrl(elementnon-null) → {string}
Gets a PlayReady license URL from a protection element
containing a PlayReady Header Object
Parameters:
Name | Type | Description |
---|---|---|
element |
Element |
- Source:
Returns:
- Type
- string
parseFromProtection(elemsnon-null, keySystemsBySystemIdnon-null) → {Array.<shaka.extern.DrmInfo>}
Parses info from the Protection elements.
Parameters:
Name | Type | Description |
---|---|---|
elems |
Array.<!Element> | |
keySystemsBySystemId |
Object.<string, string> |
- Source:
Returns:
- Type
- Array.<shaka.extern.DrmInfo>
parseMsPro_(data) → {Array.<shaka.mss.ContentProtection.PlayReadyRecord>}
Parses a buffer for PlayReady Objects. The data
should contain a 32-bit integer indicating the length of
the PRO in bytes. Following that, a 16-bit integer for
the number of PlayReady Object Records in the PRO. Lastly,
a byte array of the PRO Records themselves.
PlayReady Object format: https://goo.gl/W8yAN4
Parameters:
Name | Type | Description |
---|---|---|
data |
BufferSource |
- Source:
Returns:
- Type
- Array.<shaka.mss.ContentProtection.PlayReadyRecord>
parseMsProRecords_(viewnon-null, byteOffset) → {Array.<shaka.mss.ContentProtection.PlayReadyRecord>}
Parses an Array buffer starting at byteOffset for PlayReady Object Records.
Each PRO Record is preceded by its PlayReady Record type and length in
bytes.
PlayReady Object Record format: https://goo.gl/FTcu46
Parameters:
Name | Type | Description |
---|---|---|
view |
DataView | |
byteOffset |
number |
- Source:
Returns:
- Type
- Array.<shaka.mss.ContentProtection.PlayReadyRecord>
Type Definitions
PlayReadyRecord
The parsed result of a PlayReady object record.
Type:
- {type: number, value: !Uint8Array}
Properties:
Name | Type | Description |
---|---|---|
type |
number | Type of data stored in the record. |
value |
Uint8Array | Record content. |
- Source: