Skip to content

EncryptedMediaExtensionsAPI

Types

mediaKeys

This EncryptedMediaExtensions API interface the represents a set of keys that an associated HTMLMediaElement can use for decryption of media data during playback. See MediaKeys on MDN

type mediaKeys = {}

Module

There are methods and helpers defined in MediaKeys .

mediaKeySession

This EncryptedMediaExtensions API interface represents a context for message exchange with a content decryption module (CDM). See MediaKeySession on MDN

type mediaKeySession = {
sessionId: string,
expiration: float,
closed: Promise.t<mediaKeySessionClosedReason>,
keyStatuses: mediaKeyStatusMap,
}

Record fields

sessionId
string
expiration
float

Module

There are methods and helpers defined in MediaKeySession .

mediaKeySessionClosedReason

type mediaKeySessionClosedReason =
| @as("closed-by-application") ClosedByApplication
| @as("hardware-context-reset") HardwareContextReset
| @as("internal-error") InternalError
| @as("release-acknowledged") ReleaseAcknowledged
| @as("resource-evicted") ResourceEvicted

mediaKeySessionType

type mediaKeySessionType =
| @as("persistent-license") PersistentLicense
| @as("temporary") Temporary

mediaKeysPolicy

type mediaKeysPolicy = {mutable minHdcpVersion?: string}

Record fields

minHdcpVersion
option< string >

mediaKeysRequirement

type mediaKeysRequirement =
| @as("not-allowed") NotAllowed
| @as("optional") Optional
| @as("required") Required

mediaKeyStatus

type mediaKeyStatus =
| @as("expired") Expired
| @as("internal-error") InternalError
| @as("output-downscaled") OutputDownscaled
| @as("output-restricted") OutputRestricted
| @as("released") Released
| @as("status-pending") StatusPending
| @as("usable") Usable
| @as("usable-in-future") UsableInFuture

mediaKeyStatusMap

This EncryptedMediaExtensions API interface is a read-only map of media key statuses by key IDs. See MediaKeyStatusMap on MDN

type mediaKeyStatusMap = {size: int}

Record fields

size
int

Module

There are methods and helpers defined in MediaKeyStatusMap .

mediaKeySystemAccess

This EncryptedMediaExtensions API interface provides access to a Key System for decryption and/or a content protection provider. You can request an instance of this object using the Navigator.requestMediaKeySystemAccess method. See MediaKeySystemAccess on MDN

type mediaKeySystemAccess = {keySystem: string}

Record fields

keySystem
string

Module

There are methods and helpers defined in MediaKeySystemAccess .

mediaKeySystemConfiguration

type mediaKeySystemConfiguration = {
mutable label?: string,
mutable initDataTypes?: array<string>,
mutable audioCapabilities?: array<
mediaKeySystemMediaCapability,
>,
mutable videoCapabilities?: array<
mediaKeySystemMediaCapability,
>,
mutable distinctiveIdentifier?: mediaKeysRequirement,
mutable persistentState?: mediaKeysRequirement,
mutable sessionTypes?: array<string>,
}

Record fields

label
option< string >
initDataTypes
option< array< string > >
audioCapabilities
option< array< mediaKeySystemMediaCapability > >
videoCapabilities
option< array< mediaKeySystemMediaCapability > >
distinctiveIdentifier
persistentState
sessionTypes
option< array< string > >

mediaKeySystemMediaCapability

type mediaKeySystemMediaCapability = {
mutable contentType?: string,
mutable encryptionScheme?: Null.t<string>,
mutable robustness?: string,
}

Record fields

contentType
option< string >
encryptionScheme
option< Null.t< string > >
robustness
option< string >