---
title: MediaKeyMessageEvent()
slug: Web/API/MediaKeyMessageEvent/MediaKeyMessageEvent
tags:
  - API
  - Constructor
  - EncryptedMediaExtensions
  - MediaKeyMessageEvent
  - NeedsContent
  - NeedsExample
  - Reference
browser-compat: api.MediaKeyMessageEvent.MediaKeyMessageEvent
---
{{APIRef("EncryptedMediaExtensions")}}{{Non-standard_header}}

The **`MediaKeyMessageEvent`** constructor creates a new
{{domxref("MediaKeyMessageEvent")}} object which creates a new instance of
`MediaKeyMessageEvent`.

## Syntax

```js
var mediaKeyMessageEvent = new MediaKeyMessageEvent(typeArg, options)
```

### Parameters

- _typeArg_
  - : A {{domxref("DOMString")}} containing one of May be one
    of `license-request`, `license-renewal`, `license-renewal`,
    or `individualization-request`.
- _options_

  - : Options are as follows:

    - `messageType`: A developer-defined message type that allows
      applications to differentiate messages without parsing them.
    - `message`: An array containing the message generated by the content
      decryption module.

## Browser compatibility

{{Compat}}
