HTMLMediaElement: setMediaKeys() method

The setMediaKeys() method of the HTMLMediaElement interface returns a Promise that resolves to the passed MediaKeys, which are those used to decrypt media during playback.

Syntax

setMediaKeys(mediaKeys)

Parameters

mediaKeys

A reference to a MediaKeys object that the HTMLMediaElement can use for decryption of media data during playback.

Return value

A Promise that resolves to the passed instance of MediaKeys.

Specifications

Specification
Encrypted Media Extensions
# dom-htmlmediaelement-setmediakeys

Browser compatibility

BCD tables only load in the browser