# EventMessage

Artifact: [androidx.media3:media3-extractor](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/extractor/metadata/emsg/EventMessage.java+class:androidx.media3.extractor.metadata.emsg.EventMessage)

*** ** * ** ***


```
@UnstableApi
public final class EventMessage implements Metadata.Entry
```

<br />

*** ** * ** ***

An Event Message (emsg) as defined in ISO 23009-1.

## Summary

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/annotation/VisibleForTesting https://developer.android.com/reference/androidx/media3/extractor/metadata/emsg/EventMessage#ID3_SCHEME_ID_AOM() = "https://aomedia.org/emsg/ID3"` emsg scheme_id_uri from the [CMAF spec](https://aomediacodec.github.io/av1-id3/#semantics). |
| `static final https://developer.android.com/reference/java/lang/String.html` | `@https://developer.android.com/reference/androidx/annotation/VisibleForTesting https://developer.android.com/reference/androidx/media3/extractor/metadata/emsg/EventMessage#SCTE35_SCHEME_ID() = "urn:scte:scte35:2014:bin"` scheme_id_uri from section 7.3.2 of [SCTE 214-3 2015](https://www.scte.org/SCTEDocs/Standards/ANSI_SCTE%20214-3%202015.pdf). |

| ### Public fields |
|---|---|
| `final long` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/emsg/EventMessage#durationMs()` The duration of the event in milliseconds. |
| `final long` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/emsg/EventMessage#id()` The instance identifier. |
| `final byte[]` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/emsg/EventMessage#messageData()` The body of the message. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/emsg/EventMessage#schemeIdUri()` The message scheme. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/emsg/EventMessage#value()` The value for the event. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/extractor/metadata/emsg/EventMessage#EventMessage(java.lang.String,java.lang.String,long,long,byte[])( https://developer.android.com/reference/java/lang/String.html schemeIdUri, https://developer.android.com/reference/java/lang/String.html value, long durationMs, long id, byte[] messageData )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/emsg/EventMessage#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html obj)` |
| `@https://developer.android.com/reference/androidx/annotation/Nullable byte[]` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/emsg/EventMessage#getWrappedMetadataBytes()()` Returns the bytes of the wrapped metadata in this Entry, or null if it doesn't contain wrapped metadata. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/Format` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/emsg/EventMessage#getWrappedMetadataFormat()()` Returns the `https://developer.android.com/reference/androidx/media3/common/Format` that can be used to decode the wrapped metadata in `https://developer.android.com/reference/androidx/media3/common/Metadata.Entry#getWrappedMetadataBytes()`, or null if this Entry doesn't contain wrapped metadata. |
| `int` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/emsg/EventMessage#hashCode()()` |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/emsg/EventMessage#toString()()` |

| ### Inherited methods |
|---|
| From [androidx.media3.common.Metadata.Entry](https://developer.android.com/reference/androidx/media3/common/Metadata.Entry) |---|---| | `void` | `https://developer.android.com/reference/androidx/media3/common/Metadata.Entry#populateMediaMetadata(androidx.media3.common.MediaMetadata.Builder)(https://developer.android.com/reference/androidx/media3/common/MediaMetadata.Builder builder)` Updates the `https://developer.android.com/reference/androidx/media3/common/MediaMetadata.Builder` with the type-specific values stored in this ` Entry`. | |

## Constants

### ID3_SCHEME_ID_AOM

```
@VisibleForTesting
public static final String ID3_SCHEME_ID_AOM = "https://aomedia.org/emsg/ID3"
```

emsg scheme_id_uri from the [CMAF spec](https://aomediacodec.github.io/av1-id3/#semantics).

### SCTE35_SCHEME_ID

```
@VisibleForTesting
public static final String SCTE35_SCHEME_ID = "urn:scte:scte35:2014:bin"
```

scheme_id_uri from section 7.3.2 of [SCTE 214-3 2015](https://www.scte.org/SCTEDocs/Standards/ANSI_SCTE%20214-3%202015.pdf).

## Public fields

### durationMs

```
public final long durationMs
```

The duration of the event in milliseconds.

### id

```
public final long id
```

The instance identifier.

### messageData

```
public final byte[] messageData
```

The body of the message.

### schemeIdUri

```
public final String schemeIdUri
```

The message scheme.

### value

```
public final String value
```

The value for the event.

## Public constructors

### EventMessage

```
public EventMessage(
    String schemeIdUri,
    String value,
    long durationMs,
    long id,
    byte[] messageData
)
```

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html schemeIdUri` | The message scheme. |
| `https://developer.android.com/reference/java/lang/String.html value` | The value for the event. |
| `long durationMs` | The duration of the event in milliseconds. |
| `long id` | The instance identifier. |
| `byte[] messageData` | The body of the message. |

## Public methods

### equals

```
public boolean equals(@Nullable Object obj)
```

### getWrappedMetadataBytes

```
public @Nullable byte[] getWrappedMetadataBytes()
```

Returns the bytes of the wrapped metadata in this Entry, or null if it doesn't contain wrapped metadata.

### getWrappedMetadataFormat

```
public @Nullable Format getWrappedMetadataFormat()
```

Returns the `https://developer.android.com/reference/androidx/media3/common/Format` that can be used to decode the wrapped metadata in `https://developer.android.com/reference/androidx/media3/common/Metadata.Entry#getWrappedMetadataBytes()`, or null if this Entry doesn't contain wrapped metadata.

### hashCode

```
public int hashCode()
```

### toString

```
public String toString()
```