> Documentation index: https://developer.android.com/reference/llms.txt

# HlsMediaPlaylist.Interstitial

Artifact: [androidx.media3:media3-exoplayer-hls](https://developer.android.com/jetpack/androidx/releases/media3.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.java+class:androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist.Interstitial)

*** ** * ** ***


```
public final class HlsMediaPlaylist.Interstitial
```

<br />

*** ** * ** ***

An interstitial data range.

See RFC 8216bis, appendix D.2.

## Summary

| ### Nested types |
|---|
| `public final class HlsMediaPlaylist.Interstitial.Builder` Builder for `Interstitial`. |
| `@Retention(value = RetentionPolicy.SOURCE) @StringDef(value = ) @Documented @Target(value = ElementType.TYPE_USE) public annotation HlsMediaPlaylist.Interstitial.CueTriggerType` The cue trigger type. |
| `@Retention(value = RetentionPolicy.SOURCE) @StringDef(value = ) @Documented @Target(value = ElementType.TYPE_USE) public annotation HlsMediaPlaylist.Interstitial.NavigationRestriction` The navigation restriction identifier. |
| `@Retention(value = RetentionPolicy.SOURCE) @StringDef(value = ) @Documented @Target(value = ElementType.TYPE_USE) public annotation HlsMediaPlaylist.Interstitial.SnapType` The snap identifier. |
| `@Retention(value = RetentionPolicy.SOURCE) @StringDef(value = ) @Documented @Target(value = ElementType.TYPE_USE) public annotation HlsMediaPlaylist.Interstitial.TimelineOccupiesType` The timeline occupies identifier. |
| `@Retention(value = RetentionPolicy.SOURCE) @StringDef(value = ) @Documented @Target(value = ElementType.TYPE_USE) public annotation HlsMediaPlaylist.Interstitial.TimelineStyleType` The timeline style identifier. |

| ### Constants |
|---|---|
| `static final String` | `CUE_TRIGGER_ONCE = "ONCE"` Cue trigger type indicating to trigger the interstitial only once. |
| `static final String` | `CUE_TRIGGER_POST = "POST"` Cue trigger type indicating to trigger the interstitial after playback of the primary asset. |
| `static final String` | `CUE_TRIGGER_PRE = "PRE"` Cue trigger type indicating to trigger the interstitial before playback of the primary asset. |
| `static final String` | `NAVIGATION_RESTRICTION_JUMP = "JUMP"` Navigation restriction identifier indicating to enforce playback of the interstitial if the user attempts to seek beyond the interstitial start position. |
| `static final String` | `NAVIGATION_RESTRICTION_SKIP = "SKIP"` Navigation restriction identifier indicating to prevent seeking or changing the playback speed during the interstitial being played. |
| `static final String` | `SNAP_TYPE_IN = "IN"` Snap identifier indicating to locate the segment boundary closest to the scheduled resumption point of the interstitial. |
| `static final String` | `SNAP_TYPE_OUT = "OUT"` Snap identifier indicating to locate the segment boundary closest to the `startDateUnixUs`. |
| `static final String` | `TIMELINE_OCCUPIES_POINT = "POINT"` Timeline occupies identifier indicating to present the interstitial as a single point. |
| `static final String` | `TIMELINE_OCCUPIES_RANGE = "RANGE"` Timeline occupies identifier indicating to present the interstitial as a range. |
| `static final String` | `TIMELINE_STYLE_HIGHLIGHT = "HIGHLIGHT"` Timeline style identifier indicating to present the interstitial as distinct from the content. |
| `static final String` | `TIMELINE_STYLE_PRIMARY = "PRIMARY"` Timeline style identifier indicating not to differentiate the interstitial from the content. |

| ### Public fields |
|---|---|
| `final @Nullable Uri` | `assetListUri` The asset list URI. |
| `final @Nullable Uri` | `assetUri` The asset URI. |
| `final ImmutableList<HlsMediaPlaylist.ClientDefinedAttribute>` | `clientDefinedAttributes` The attributes defined by a client. |
| `final boolean` | `contentMayVary` Whether the content may vary between clients. |
| `final List<@HlsMediaPlaylist.Interstitial.CueTriggerType String>` | `cue` The trigger cue types. |
| `final long` | `durationUs` The optional duration, in microseconds. |
| `final long` | `endDateUnixUs` The optional end time, in microseconds. |
| `final boolean` | `endOnNext` Whether the `endDateUnixUs` of the interstitial is equal to the start `startTimeUs` of the following interstitial. |
| `final String` | `id` The required ID. |
| `final long` | `plannedDurationUs` The optional planned duration, in microseconds. |
| `final long` | `playoutLimitUs` The playout limit indicating the limit of the playback time of the interstitial. |
| `final ImmutableList<@HlsMediaPlaylist.Interstitial.NavigationRestriction String>` | `restrictions` The navigation restrictions. |
| `final long` | `resumeOffsetUs` The offset from `startTimeUs` indicating where in the primary asset to resume playback after completing playback of the interstitial. |
| `final long` | `skipControlDurationUs` The duration of interstitial content the skip button should be displayed, in microseconds. |
| `final @Nullable String` | `skipControlLabelId` The ID of the label to be displayed on the skip control button. |
| `final long` | `skipControlOffsetUs` The offset from the start of the interstitial after which the skip control button is displayed, in microseconds. |
| `final ImmutableList<@HlsMediaPlaylist.Interstitial.SnapType String>` | `snapTypes` The snap types. |
| `final long` | `startDateUnixUs` The required start time, in microseconds. |
| `final @HlsMediaPlaylist.Interstitial.TimelineOccupiesType String` | `@HlsMediaPlaylist.Interstitial.TimelineOccupiesType timelineOccupies` The timeline occupies type. |
| `final @HlsMediaPlaylist.Interstitial.TimelineStyleType String` | `@HlsMediaPlaylist.Interstitial.TimelineStyleType timelineStyle` The timeline style type. |

| ### Public constructors |
|---|
| `Interstitial( String id, @Nullable Uri assetUri, @Nullable Uri assetListUri, long startDateUnixUs, long endDateUnixUs, long durationUs, long plannedDurationUs, List<@HlsMediaPlaylist.Interstitial.CueTriggerType String> cue, boolean endOnNext, long resumeOffsetUs, long playoutLimitUs, List<@HlsMediaPlaylist.Interstitial.SnapType String> snapTypes, List<@HlsMediaPlaylist.Interstitial.NavigationRestriction String> restrictions, List<HlsMediaPlaylist.ClientDefinedAttribute> clientDefinedAttributes, boolean contentMayVary, @HlsMediaPlaylist.Interstitial.TimelineOccupiesType @HlsMediaPlaylist.Interstitial.TimelineOccupiesType String timelineOccupies, @HlsMediaPlaylist.Interstitial.TimelineStyleType @HlsMediaPlaylist.Interstitial.TimelineStyleType String timelineStyle, long skipControlOffsetUs, long skipControlDurationUs, @Nullable String skipControlLabelId )` Creates an instance. |

| ### Public methods |
|---|---|
| `boolean` | `equals(@Nullable Object o)` |
| `int` | `hashCode()` |

## Constants

### CUE_TRIGGER_ONCE

```
public static final String CUE_TRIGGER_ONCE = "ONCE"
```

Cue trigger type indicating to trigger the interstitial only once.

### CUE_TRIGGER_POST

```
public static final String CUE_TRIGGER_POST = "POST"
```

Cue trigger type indicating to trigger the interstitial after playback of the primary asset.

### CUE_TRIGGER_PRE

```
public static final String CUE_TRIGGER_PRE = "PRE"
```

Cue trigger type indicating to trigger the interstitial before playback of the primary asset.

### NAVIGATION_RESTRICTION_JUMP

```
public static final String NAVIGATION_RESTRICTION_JUMP = "JUMP"
```

Navigation restriction identifier indicating to enforce playback of the interstitial if the user attempts to seek beyond the interstitial start position.

### NAVIGATION_RESTRICTION_SKIP

```
public static final String NAVIGATION_RESTRICTION_SKIP = "SKIP"
```

Navigation restriction identifier indicating to prevent seeking or changing the playback speed during the interstitial being played.

### SNAP_TYPE_IN

```
public static final String SNAP_TYPE_IN = "IN"
```

Snap identifier indicating to locate the segment boundary closest to the scheduled resumption point of the interstitial.

### SNAP_TYPE_OUT

```
public static final String SNAP_TYPE_OUT = "OUT"
```

Snap identifier indicating to locate the segment boundary closest to the `startDateUnixUs`.

### TIMELINE_OCCUPIES_POINT

```
public static final String TIMELINE_OCCUPIES_POINT = "POINT"
```

Timeline occupies identifier indicating to present the interstitial as a single point.

### TIMELINE_OCCUPIES_RANGE

```
public static final String TIMELINE_OCCUPIES_RANGE = "RANGE"
```

Timeline occupies identifier indicating to present the interstitial as a range.

### TIMELINE_STYLE_HIGHLIGHT

```
public static final String TIMELINE_STYLE_HIGHLIGHT = "HIGHLIGHT"
```

Timeline style identifier indicating to present the interstitial as distinct from the content.

### TIMELINE_STYLE_PRIMARY

```
public static final String TIMELINE_STYLE_PRIMARY = "PRIMARY"
```

Timeline style identifier indicating not to differentiate the interstitial from the content.

## Public fields

### assetListUri

```
public final @Nullable Uri assetListUri
```

The asset list URI. Required if `assetUri` is null.

### assetUri

```
public final @Nullable Uri assetUri
```

The asset URI. Required if `assetListUri` is null.

### clientDefinedAttributes

```
public final ImmutableList<HlsMediaPlaylist.ClientDefinedAttribute> clientDefinedAttributes
```

The attributes defined by a client. For informational purpose only.

### contentMayVary

```
public final boolean contentMayVary
```

Whether the content may vary between clients.

### cue

```
public final List<@HlsMediaPlaylist.Interstitial.CueTriggerType String> cue
```

The trigger cue types.

### durationUs

```
public final long durationUs
```

The optional duration, in microseconds. `TIME_UNSET` if not present.

### endDateUnixUs

```
public final long endDateUnixUs
```

The optional end time, in microseconds. `TIME_UNSET` if not present.

### endOnNext

```
public final boolean endOnNext
```

Whether the `endDateUnixUs` of the interstitial is equal to the start `startTimeUs` of the following interstitial. `false` if not present.

### id

```
public final String id
```

The required ID.

### plannedDurationUs

```
public final long plannedDurationUs
```

The optional planned duration, in microseconds. `TIME_UNSET` if not present.

### playoutLimitUs

```
public final long playoutLimitUs
```

The playout limit indicating the limit of the playback time of the interstitial.

### restrictions

```
public final ImmutableList<@HlsMediaPlaylist.Interstitial.NavigationRestriction String> restrictions
```

The navigation restrictions.

### resumeOffsetUs

```
public final long resumeOffsetUs
```

The offset from `startTimeUs` indicating where in the primary asset to resume playback after completing playback of the interstitial. `TIME_UNSET` if not present. If not present, the value is considered to be the duration of the interstitial.

### skipControlDurationUs

```
public final long skipControlDurationUs
```

The duration of interstitial content the skip button should be displayed, in microseconds. `TIME_UNSET` if not present and the skip button should be displayed until the end of the interstitial.

### skipControlLabelId

```
public final @Nullable String skipControlLabelId
```

The ID of the label to be displayed on the skip control button. Null if not present.

### skipControlOffsetUs

```
public final long skipControlOffsetUs
```

The offset from the start of the interstitial after which the skip control button is displayed, in microseconds. `TIME_UNSET` if not present.

### snapTypes

```
public final ImmutableList<@HlsMediaPlaylist.Interstitial.SnapType String> snapTypes
```

The snap types.

### startDateUnixUs

```
public final long startDateUnixUs
```

The required start time, in microseconds.

### timelineOccupies

```
@HlsMediaPlaylist.Interstitial.TimelineOccupiesType
public final @HlsMediaPlaylist.Interstitial.TimelineOccupiesType String timelineOccupies
```

The timeline occupies type.

### timelineStyle

```
@HlsMediaPlaylist.Interstitial.TimelineStyleType
public final @HlsMediaPlaylist.Interstitial.TimelineStyleType String timelineStyle
```

The timeline style type.

## Public constructors

### Interstitial

```
public Interstitial(
    String id,
    @Nullable Uri assetUri,
    @Nullable Uri assetListUri,
    long startDateUnixUs,
    long endDateUnixUs,
    long durationUs,
    long plannedDurationUs,
    List<@HlsMediaPlaylist.Interstitial.CueTriggerType String> cue,
    boolean endOnNext,
    long resumeOffsetUs,
    long playoutLimitUs,
    List<@HlsMediaPlaylist.Interstitial.SnapType String> snapTypes,
    List<@HlsMediaPlaylist.Interstitial.NavigationRestriction String> restrictions,
    List<HlsMediaPlaylist.ClientDefinedAttribute> clientDefinedAttributes,
    boolean contentMayVary,
    @HlsMediaPlaylist.Interstitial.TimelineOccupiesType @HlsMediaPlaylist.Interstitial.TimelineOccupiesType String timelineOccupies,
    @HlsMediaPlaylist.Interstitial.TimelineStyleType @HlsMediaPlaylist.Interstitial.TimelineStyleType String timelineStyle,
    long skipControlOffsetUs,
    long skipControlDurationUs,
    @Nullable String skipControlLabelId
)
```

Creates an instance.

## Public methods

### equals

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

### hashCode

```
public int hashCode()
```