# ChapterFrame

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/id3/ChapterFrame.java+class:androidx.media3.extractor.metadata.id3.ChapterFrame)

*** ** * ** ***


```
@UnstableApi
public final class ChapterFrame extends Id3Frame implements Chapter
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.media3.extractor.metadata.id3.Id3Frame](https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/Id3Frame) ||
|   | ↳ | [androidx.media3.extractor.metadata.id3.ChapterFrame](https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame) |

*** ** * ** ***

Chapter information ID3 frame.

## Summary

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#ID() = "CHAP"` |

| ### Public fields |
|---|---|
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#chapterId()` |
| `final long` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#endOffset()` The byte offset of the end of the chapter, or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if not set. |
| `final int` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#endTimeMs()` |
| `final long` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#startOffset()` The byte offset of the start of the chapter, or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if not set. |
| `final int` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#startTimeMs()` |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/Label` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#title()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#ChapterFrame(java.lang.String,int,int,long,long,androidx.media3.extractor.metadata.id3.Id3Frame[])( https://developer.android.com/reference/java/lang/String.html chapterId, int startTimeMs, int endTimeMs, long startOffset, long endOffset, Id3Frame[] subFrames )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html obj)` |
| `long` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#getEndTimeMs()()` Returns the end time of the chapter in milliseconds, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if unknown. |
| `long` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#getStartTimeMs()()` Returns the start time of the chapter in milliseconds, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if unknown. |
| `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/Id3Frame` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#getSubFrame(int)(int index)` Returns the sub-frame at `index`. |
| `int` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#getSubFrameCount()()` Returns the number of sub-frames. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/Label` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#getTitle()()` Returns the title of the chapter, or `null` if it has no title. |
| `int` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#hashCode()()` |
| `boolean` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/ChapterFrame#isHidden()()` Returns whether the chapter is hidden. |

| ### Inherited fields |
|---|
| From [androidx.media3.extractor.metadata.id3.Id3Frame](https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/Id3Frame) |---|---| | `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/Id3Frame#id()` The frame ID. | |

| ### Inherited methods |
|---|
| From [androidx.media3.extractor.metadata.id3.Id3Frame](https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/Id3Frame) |---|---| | `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/extractor/metadata/id3/Id3Frame#toString()()` | |
| From [androidx.media3.common.Metadata.Entry](https://developer.android.com/reference/androidx/media3/common/Metadata.Entry) |---|---| | `@https://developer.android.com/reference/androidx/annotation/Nullable byte[]` | `https://developer.android.com/reference/androidx/media3/common/Metadata.Entry#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/common/Metadata.Entry#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. | | `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

### ID

```
public static final String ID = "CHAP"
```

## Public fields

### chapterId

```
public final String chapterId
```

### endOffset

```
public final long endOffset
```

The byte offset of the end of the chapter, or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if not set.

### endTimeMs

```
public final int endTimeMs
```

### startOffset

```
public final long startOffset
```

The byte offset of the start of the chapter, or `https://developer.android.com/reference/androidx/media3/common/C#INDEX_UNSET()` if not set.

### startTimeMs

```
public final int startTimeMs
```

### title

```
public final @Nullable Label title
```

## Public constructors

### ChapterFrame

```
public ChapterFrame(
    String chapterId,
    int startTimeMs,
    int endTimeMs,
    long startOffset,
    long endOffset,
    Id3Frame[] subFrames
)
```

## Public methods

### equals

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

### getEndTimeMs

```
public long getEndTimeMs()
```

Returns the end time of the chapter in milliseconds, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if unknown.

### getStartTimeMs

```
public long getStartTimeMs()
```

Returns the start time of the chapter in milliseconds, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if unknown.

### getSubFrame

```
public Id3Frame getSubFrame(int index)
```

Returns the sub-frame at `index`.

### getSubFrameCount

```
public int getSubFrameCount()
```

Returns the number of sub-frames.

### getTitle

```
public @Nullable Label getTitle()
```

Returns the title of the chapter, or `null` if it has no title.

### hashCode

```
public int hashCode()
```

### isHidden

```
public boolean isHidden()
```

Returns whether the chapter is hidden.

A hidden chapter should not be shown in a table of contents UI, but should not affect playback.