Constructor
new DrmEngine(networkingEnginenon-null, onError, onKeyStatus)
Parameters:
| Name | Type | Description | 
|---|---|---|
| networkingEngine | shaka.net.NetworkingEngine | |
| onError | function(!shaka.util.Error) | Called when an error occurs. | 
| onKeyStatus | function(!Object.<string, string>) | Called when key status changes. Argument is a map of hex key IDs to statuses. | 
- Implements:
- Source:
Members
- 
    (private, non-null) activeSessions_ :Array.<shaka.media.DrmEngine.ActiveSession>
- 
    
    
        Type:- Source:
 
- 
    (private, nullable) config_ :shakaExtern.DrmConfiguration
- 
    
    
        Type:- Source:
 
- 
    (private) destroyed_ :boolean
- 
    
    
        Type:- boolean
 - Source:
 
- 
    (private, non-null) drmInfos_ :Array.<shakaExtern.DrmInfo>
- 
    
    
        Type:- Array.<shakaExtern.DrmInfo>
 - Source:
 
- 
    (private) eventManager_ :shaka.util.EventManager
- 
    
    
        Type:- Source:
 
- 
    (private) initialized_ :boolean
- 
    
    
        Type:- boolean
 - Source:
 
- 
    (private) keySystem_ :string
- 
    
    
        Type:- string
 - Source:
 
- 
    (private) licenseServerUri_ :string
- 
    
    
        Type:- string
 - Source:
 
- 
    (private) mediaKeys_ :MediaKeys
- 
    
    
        Type:- MediaKeys
 - Source:
 
- 
    (private) networkingEngine_ :shaka.net.NetworkingEngine
- 
    
    
        Type:- Source:
 
- 
    (private, nullable) onError_ :?function(!shaka.util.Error)
- 
    
    
        Type:- ?function(!shaka.util.Error)
 - Source:
 
- 
    (private, nullable) onKeyStatus_ :?function(!Object.<string, string>)
- 
    
    
        Type:- ?function(!Object.<string, string>)
 - Source:
 
- 
    (private) video_ :HTMLMediaElement
- 
    
    
        Type:- HTMLMediaElement
 - Source:
 
Methods
- 
    
        
            
            (static) support() → (non-null) {Promise.<!Object.<string, boolean>>}
- 
    
    Returns a Promise to a map of EME support for well-known key systems.- Source:
 Returns:- Type
- Promise.<!Object.<string, boolean>>
 
- 
    
        
            
            attach(video) → (non-null) {Promise}
- 
    
    Attach MediaKeys to the video element and start processing events.Parameters:Name Type Description videoHTMLMediaElement - Source:
 Returns:- Type
- Promise
 
- 
    
        
            
            configure(config)
- 
    
    Called by the Player to provide an updated configuration any time it changes. Must be called at least once before init().Parameters:Name Type Description configshakaExtern.DrmConfiguration - Source:
 
- 
    
        
            
            (private) configureClearKey_() → (nullable) {shakaExtern.DrmInfo}
- 
    
    Create a DrmInfo using configured clear keys. The server URI will be a data URI which decodes to a clearkey license.- Source:
- See:
 Returns:or null if clear keys are not configured.- Type
- shakaExtern.DrmInfo
 
- 
    
        
            
            (private) createTemporarySession_(initDataType, initDatanon-null)
- 
    
    
    
    
    
        Parameters:Name Type Description initDataTypestring initDataUint8Array - Source:
 
- 
    
        
            
            destroy() → (non-null) {Promise}
- 
    
    Destroys the object, releasing all resources and shutting down all operations. Returns a Promise which is resolved when destruction is complete. This Promise should never be rejected.- Implements:
- Source:
 Returns:- Type
- Promise
 
- 
    
        
            
            (private) fillInDrmInfoDefaults_(drmInfo)
- 
    
    Use this.config_ to fill in missing values in drmInfo.Parameters:Name Type Description drmInfoshakaExtern.DrmInfo - Source:
 
- 
    
        
            
            init(manifestnon-null, offline) → (non-null) {Promise}
- 
    
    Negotiate for a key system and set up MediaKeys.Parameters:Name Type Description manifestshakaExtern.Manifest The manifest is read for MIME type and DRM information to query EME. If the 'clearKeys' configuration is used, the manifest will be modified to force the use of Clear Key. offlineboolean True if we are storing or loading offline content. - Source:
 Returns:Resolved if/when a key system has been chosen.- Type
- Promise
 
- 
    
        
            
            initialized() → {boolean}
- 
    
    
    
    
    
    
- Source:
 Returns:- Type
- boolean
 
- 
    
        
            
            keySystem() → {string}
- 
    
    
    
    
    
    
- Source:
 Returns:- Type
- string
 
- 
    
        
            
            (private) onEncrypted_(eventnon-null)
- 
    
    
    
    
    
        Parameters:Name Type Description eventMediaEncryptedEvent - Source:
 
- 
    
        
            
            (private) onKeyStatusesChange_(eventnon-null)
- 
    
    
    
    
    
        Parameters:Name Type Description eventEvent - Source:
 
- 
    
        
            
            (private) onSessionMessage_(eventnon-null)
- 
    
    
    
    
    
        Parameters:Name Type Description eventMediaKeyMessageEvent - Source:
 
- 
    
        
            
            (private) prepareMediaKeyConfigs_(manifestnon-null, offline, configsByKeySystemnon-null, keySystemsInOrdernon-null)
- 
    
    
    
    
    
        Parameters:Name Type Description manifestshakaExtern.Manifest offlineboolean True if we are storing or loading offline content. configsByKeySystemObject.<string, MediaKeySystemConfiguration> (Output parameter.) A dictionary of configs, indexed by key system. keySystemsInOrderArray.<string> (Output parameter.) A list of key systems in the order in which we encounter them. 
- 
    
        
            
            (private) processDrmInfos_(licenseServersnon-null, serverCertsnon-null, initDatasnon-null)
- 
    
    Extract license server, server cert, and init data from DrmInfos, taking care to eliminate duplicates.Parameters:Name Type Description licenseServersArray.<string> serverCertsArray.<!Uint8Array> initDatasArray.<!shakaExtern.InitDataOverride> - Source:
 
- 
    
        
            
            (private) queryMediaKeys_(configsByKeySystemnon-null, keySystemsInOrdernon-null) → (non-null) {Promise}
- 
    
    
    
    
    
        Parameters:Name Type Description configsByKeySystemObject.<string, MediaKeySystemConfiguration> A dictionary of configs, indexed by key system. keySystemsInOrderArray.<string> A list of key systems in the order in which we should query them. On a browser which supports multiple key systems, the order may indicate a real preference for the application. - Source:
 Returns:Resolved if/when a key system has been chosen.- Type
- Promise
 
- 
    
        
            
            (private) unpackPlayReadyRequest_(request)
- 
    
    Unpack PlayReady license requests. Modifies the request object.Parameters:Name Type Description requestshakaExtern.Request - Source:
 
Type Definitions
- 
    ActiveSession
- 
    
    A record to track sessions and suppress duplicate init data.Type:- {initData: !Uint8Array, session: !MediaKeySession}
 Properties:Name Type Description initDataUint8Array The init data used to create the session. sessionMediaKeySession The session object. - Source: