Constructor
new ContentProtection()
A set of functions for parsing and interpreting ContentProtection elements.
- Implements:
 - Source:
 
Members
licenseUrlParsers_ :Map<string, function(shaka.dash.ContentProtection.Element)>
    A map of key system name to license server url parser.
    Type:
- Map<string, function(shaka.dash.ContentProtection.Element)>
 
- Source:
 
psshToInitData_ :Map<string, !Uint8Array>
Type:
- Map<string, !Uint8Array>
 
- Source:
 
Methods
convertElements_(defaultInit, encryptionScheme, elementsnon-null, keySystemsByURInon-null, keyIdsnon-null) → {Array<shaka.extern.DrmInfo>}
    Creates DrmInfo objects from the given element.
    Parameters:
| Name | Type | Description | 
|---|---|---|
defaultInit | 
            
            Array<shaka.extern.InitDataOverride> | |
encryptionScheme | 
            
            string | |
elements | 
            
            Array<shaka.dash.ContentProtection.Element> | |
keySystemsByURI | 
            
            Object<string, string> | |
keyIds | 
            
            Set<string> | 
- Source:
 
Returns:
- Type
 - Array<shaka.extern.DrmInfo>
 
getClearKeyLicenseUrl(element) → {string}
    Gets a ClearKey license URL from a content protection element
containing a custom `clearkey::Laurl` or 'dashif:Laurl' elements
    Parameters:
| Name | Type | Description | 
|---|---|---|
element | 
            
            shaka.dash.ContentProtection.Element | 
- Source:
 
Returns:
- Type
 - string
 
getFairPlayLicenseUrl(element) → {string}
    Gets a FairPlay license URL from a content protection element
containing a 'dashif:Laurl' element
    Parameters:
| Name | Type | Description | 
|---|---|---|
element | 
            
            shaka.dash.ContentProtection.Element | 
- Source:
 
Returns:
- Type
 - string
 
getInitDataClearKey_(element, keyIdsnon-null) → {Array<shaka.extern.InitDataOverride>}
    Creates ClearKey initData from Default_KID value retrieved from previously
parsed ContentProtection tag.
    Parameters:
| Name | Type | Description | 
|---|---|---|
element | 
            
            shaka.dash.ContentProtection.Element | |
keyIds | 
            
            Set<string> | 
- Source:
 
Returns:
- Type
 - Array<shaka.extern.InitDataOverride>
 
getInitDataFromPro_(element) → {Array<shaka.extern.InitDataOverride>}
    Gets a PlayReady initData from a content protection element
containing a PlayReady Pro Object
    Parameters:
| Name | Type | Description | 
|---|---|---|
element | 
            
            shaka.dash.ContentProtection.Element | 
- Source:
 
Returns:
- Type
 - Array<shaka.extern.InitDataOverride>
 
getPlayReadyLicenseUrl(element) → {string}
    Gets a PlayReady license URL from a content protection element
containing a PlayReady Header Object
    Parameters:
| Name | Type | Description | 
|---|---|---|
element | 
            
            shaka.dash.ContentProtection.Element | 
- Source:
 
Returns:
- Type
 - string
 
getWidevineLicenseUrl(element) → {string}
    Gets a Widevine license URL from a content protection element
containing a custom `ms:laurl` or 'dashif:Laurl' elements
    Parameters:
| Name | Type | Description | 
|---|---|---|
element | 
            
            shaka.dash.ContentProtection.Element | 
- Source:
 
Returns:
- Type
 - string
 
parseAes128_(element) → {shaka.dash.ContentProtection.Aes128Info}
    Parses the given AES-128 ContentProtection element.
    Parameters:
| Name | Type | Description | 
|---|---|---|
element | 
            
            shaka.dash.ContentProtection.Element | 
- Source:
 
Returns:
parseElement_(elemnon-null) → {shaka.dash.ContentProtection.Element}
    Parses the given ContentProtection element.
    Parameters:
| Name | Type | Description | 
|---|---|---|
elem | 
            
            shaka.extern.xml.Node | 
- Source:
 
Returns:
parseElements_(elementsnon-null) → {Array<shaka.dash.ContentProtection.Element>}
    Parses the given ContentProtection elements.  If there is an error, it
removes those elements.
    Parameters:
| Name | Type | Description | 
|---|---|---|
elements | 
            
            Array<!shaka.extern.xml.Node> | 
- Source:
 
Returns:
- Type
 - Array<shaka.dash.ContentProtection.Element>
 
parseFromAdaptationSet(elementsnon-null, ignoreDrmInfo, keySystemsByURInon-null) → {shaka.dash.ContentProtection.Context}
    Parses info from the ContentProtection elements at the AdaptationSet level.
    Parameters:
| Name | Type | Description | 
|---|---|---|
elements | 
            
            Array<!shaka.extern.xml.Node> | |
ignoreDrmInfo | 
            
            boolean | |
keySystemsByURI | 
            
            Object<string, string> | 
- Source:
 
Returns:
parseFromRepresentation(elementsnon-null, context, ignoreDrmInfo, keySystemsByURInon-null) → {string}
    Parses the given ContentProtection elements found at the Representation
level.  This may update the |context|.
    Parameters:
| Name | Type | Description | 
|---|---|---|
elements | 
            
            Array<!shaka.extern.xml.Node> | |
context | 
            
            shaka.dash.ContentProtection.Context | |
ignoreDrmInfo | 
            
            boolean | |
keySystemsByURI | 
            
            Object<string, string> | 
- Source:
 
Returns:
    The parsed key ID
- Type
 - string
 
release()
    Request that this object release all internal references.
- Implements:
 - Source:
 
Type Definitions
Aes128Info
    Contains information about the AES-128 keyUri and IV found at the
AdaptationSet level.
    Type:
- {keyUri: string, iv: !Uint8Array}
 
Properties:
| Name | Type | Description | 
|---|---|---|
method | 
            
            
            string | The keyUri in the manifest. | 
iv | 
            
            
            Uint8Array | The IV in the manifest. | 
- Source:
 
Context
    Contains information about the ContentProtection elements found at the
AdaptationSet level.
    Type:
- {defaultKeyId: ?string, defaultInit: Array<shaka.extern.InitDataOverride>, drmInfos: !Array<shaka.extern.DrmInfo>, aes128Info: ?shaka.dash.ContentProtection.Aes128Info, firstRepresentation: boolean}
 
Properties:
| Name | Type | Attributes | Description | 
|---|---|---|---|
defaultKeyId | 
            
            
            string | 
                
                
                    <nullable> | 
            
            
            The default key ID to use. This is used by parseKeyIds as a default. This can be null to indicate that there is no default. | 
defaultInit | 
            
            
            Array<shaka.extern.InitDataOverride> | The default init data override. This can be null to indicate that there is no default. | |
drmInfos | 
            
            
            Array<shaka.extern.DrmInfo> | The DrmInfo objects. | |
aes128Info | 
            
            
            shaka.dash.ContentProtection.Aes128Info | 
                
                
                    <nullable> | 
            
            
            The AES-128 key info. | 
firstRepresentation | 
            
            
            boolean | True when first parsed; changed to false after the first call to parseKeyIds. This is used to determine if a dummy key-system should be overwritten; namely that the first representation can replace the dummy from the AdaptationSet. | 
- Source:
 
Element
    The parsed result of a single ContentProtection element.
    Type:
- {node: !shaka.extern.xml.Node, schemeUri: string, keyId: ?string, init: Array<shaka.extern.InitDataOverride>, encryptionScheme: ?string}
 
Properties:
| Name | Type | Attributes | Description | 
|---|---|---|---|
node | 
            
            
            shaka.extern.xml.Node | The ContentProtection XML element. | |
schemeUri | 
            
            
            string | The scheme URI. | |
keyId | 
            
            
            string | 
                
                
                    <nullable> | 
            
            
            The default key ID, if present. | 
init | 
            
            
            Array<shaka.extern.InitDataOverride> | The init data, if present. If there is no init data, it will be null. If this is non-null, there is at least one element. | |
encryptionScheme | 
            
            
            string | 
                
                
                    <nullable> | 
            
            
            The encryption scheme, if present. | 
- Source: