Class: shaka.polyfill.PatchedMediaKeysWebkit.MediaKeySession

Constructor

new MediaKeySession(medianon-null, keySystem, sessionType)

An implementation of MediaKeySession.
Parameters:
Name Type Description
media HTMLMediaElement
keySystem string
sessionType string
Implements:
  • MediaKeySession
Extends:
Source:

Extends

Members

dispatchTarget :EventTarget

The target of all dispatched events. Defaults to |this|.
Type:
  • EventTarget
Inherited From:
Source:

expiration :number

Type:
  • number
Source:

(private) initialized_ :boolean

Type:
  • boolean
Source:

(private) keySystem_ :string

Type:
  • string
Source:

sessionId :string

Type:
  • string
Source:

(private) type_ :string

Type:
  • string
Source:

Methods

(export) addEventListener(type, listener, opt_optionsopt)

Add an event listener to this object.
Parameters:
Name Type Attributes Description
type string The event type to listen for.
listener shaka.util.FakeEventTarget.ListenerType The callback or listener object to invoke.
opt_options AddEventListenerOptions | boolean <optional>
Ignored.
Inherited From:
Source:

(export) dispatchEvent(eventnon-null) → {boolean}

Dispatch an event from this object.
Parameters:
Name Type Description
event Event The event to be dispatched from this object.
Inherited From:
Source:
Returns:
True if the default action was prevented.
Type
boolean

(private) generate_(initDatanullable, offlineSessionIdnullable) → (non-null) {Promise}

Logic which is shared between generateRequest() and load(), both of which are ultimately implemented with webkitGenerateKeyRequest in prefixed EME.
Parameters:
Name Type Attributes Description
initData BufferSource <nullable>
offlineSessionId string <nullable>
Source:
Returns:
Type
Promise

(protected) generated()

Signals that the license request has been generated. This resolves the 'generateRequest' promise.
Source:

handleError(eventnon-null)

Either rejects a promise, or dispatches an error event, as appropriate.
Parameters:
Name Type Description
event MediaKeyEvent
Source:

(protected) ready()

Signals that the session is 'ready', which is the terminology used in older versions of EME. The new signal is to resolve the 'update' promise. This translates between the two.
Source:

(export) removeEventListener(type, listener, opt_optionsopt)

Remove an event listener from this object.
Parameters:
Name Type Attributes Description
type string The event type for which you wish to remove a listener.
listener shaka.util.FakeEventTarget.ListenerType The callback or listener object to remove.
opt_options EventListenerOptions | boolean <optional>
Ignored.
Inherited From:
Source:

(private) update_(promisenon-null, responsenullable)

An internal version of update which defers new calls while old ones are in progress.
Parameters:
Name Type Attributes Description
promise shaka.util.PublicPromise The promise associated with this call.
response BufferSource <nullable>
Source:

(private) updateKeyStatus_(status)

Update key status and dispatch a 'keystatuseschange' event.
Parameters:
Name Type Description
status string
Source: