Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazonアプリストア
Ring
AWS
ドキュメント
Support
Contact Us
My Cases
開発
設計と開発
公開
リファレンス
サポート
アクセスいただきありがとうございます。こちらのページは現在英語のみのご用意となっております。順次日本語化を進めてまいりますので、ご理解のほどよろしくお願いいたします。

MediaKeys

The MediaKeys object represents a set of keys that an associated HTMLMediaElement can use for decryption of media data during playback. It also represents a CDM instance.

For more information, see https://www.w3.org/TR/encrypted-media/#mediakeys-interface

Methods

createSession()

createSession(sessionType?: MediaKeySessionType | undefined): MediaKeySession

Creates a new MediaKeySession object.

For more information, see https://www.w3.org/TR/encrypted-media/#dom-mediakeys-createsession.

Parameters

sessionType?

MediaKeySessionType | undefined

The type of session to create. The session type affects the behavior of the returned object.

Returns

MediaKeySession


setServerCertificate()

setServerCertificate(serverCertificate: ArrayBuffer): Promise<boolean>

Provides a server certificate to be used to encrypt messages to the license server.

For more information, see https://www.w3.org/TR/encrypted-media/#dom-mediakeys-setservercertificate.

Parameters

serverCertificate

ArrayBuffer

The server certificate. The contents are Key System-specific. It must not contain executable code. Promise Resolved when certificate is successfully set. Reject if failed.

Returns

Promise<boolean>


getStatusForPolicy()

getStatusForPolicy(policy?: MediaKeysPolicy | undefined): Promise<MediaKeyStatus>

Returns a MediaKeyStatus for a given MediaKeysPolicy.

For more information, see https://www.w3.org/TR/encrypted-media/#dom-mediakeys-getstatusforpolicy

Parameters

policy?

MediaKeysPolicy | undefined

Returns

Promise<MediaKeyStatus>


Last updated: Jul 22, 2026