Interface: Persistent

Persistent

object which should be passed during the initialization for DownstreamElectronFE#init. It should implements 2 methods for creating and removing the persistent session

Members

PersistentConfig

persistent config needed to be passed to Persistent#createPersistentSession
Properties:
Name Type Attributes Description
licenseUrl string url to license server
serverCertificate Uint8Array server certificate
pssh string <optional>
protection information from manifest for widevine (ContentProtection), this is base64 string if not provided it will be injected automatically by API
licenseRequest object <optional>
The callback function that will be triggered before the request, for example when you need to add request headers
licenseResponse object <optional>
The callback function that will be triggered with the request
Example
var config = {
  licenseUrl: 'https://lic.staging.drmtoday.com/license-proxy-widevine/cenc/',
  serverCertificate: new Uint8Array(<server_certificate>),
  licenseRequest: function (request) {
    request.setRequestHeader('<headerParam>', '<headerValue>');
    .....
    request.setRequestHeader('Authorization', '........');
    request.setRequestHeader('dt-custom-data', '........');
  },
  licenseResponse: function (request) {
    console.log(request.getAllResponseHeaders());
  }
};

Methods

createPersistentSession(config) → {Promise}

should create a persistent session and resolve it with sessionId
Parameters:
Name Type Description
config Persistent#PersistentConfig persistent config
Returns:
Type
Promise

removePersistentSession(sessionId) → {Promise}

remove persistent session
Parameters:
Name Type Description
sessionId string session identifier
Returns:
Type
Promise