HlsMediaPlaylist.Interstitial.Builder


class HlsMediaPlaylist.Interstitial.Builder


Builder for Interstitial.

See RFC 8216bis, section 4.4.5.1 for how to consolidate multiple interstitials with the same ID.

Summary

Public constructors

Creates the builder.

Public functions

HlsMediaPlaylist.Interstitial?

Builds and returns a new Interstitial instance or null if validation of the properties fails.

HlsMediaPlaylist.Interstitial.Builder!

Sets the asset list URI.

HlsMediaPlaylist.Interstitial.Builder!

Sets the asset URI.

HlsMediaPlaylist.Interstitial.Builder!

Sets the client defined attributes.

HlsMediaPlaylist.Interstitial.Builder!

Sets whether the content may vary between clients.

HlsMediaPlaylist.Interstitial.Builder!

Sets the cue trigger types.

HlsMediaPlaylist.Interstitial.Builder!

Sets the duration, in microseconds.

HlsMediaPlaylist.Interstitial.Builder!

Sets the end date as a unix epoch timestamp, in microseconds.

HlsMediaPlaylist.Interstitial.Builder!

Sets whether the interstitial ends on the start time of the next interstitial.

HlsMediaPlaylist.Interstitial.Builder!

Sets the planned duration, in microseconds.

HlsMediaPlaylist.Interstitial.Builder!

Sets the play out limit, in microseconds.

HlsMediaPlaylist.Interstitial.Builder!

Sets the navigation restrictions.

HlsMediaPlaylist.Interstitial.Builder!

Sets the resume offset, in microseconds.

HlsMediaPlaylist.Interstitial.Builder!

Sets the snap types.

HlsMediaPlaylist.Interstitial.Builder!

Sets the start date as a unix epoch timestamp, in microseconds.

HlsMediaPlaylist.Interstitial.Builder!

Sets the timeline occupies type.

HlsMediaPlaylist.Interstitial.Builder!

Sets the timeline style type.

Public constructors

Builder

Builder(id: String!)

Creates the builder.

Parameters
id: String!

The id.

Public functions

build

fun build(): HlsMediaPlaylist.Interstitial?

Builds and returns a new Interstitial instance or null if validation of the properties fails. The properties are considered invalid, if the start date is missing or both asset URI and asset list URI are set at the same time.

setAssetListUri

@CanIgnoreReturnValue
fun setAssetListUri(assetListUri: Uri?): HlsMediaPlaylist.Interstitial.Builder!

Sets the asset list URI.

Throws
java.lang.IllegalArgumentException

if called with a non-null value that is different to the value previously set.

setAssetUri

@CanIgnoreReturnValue
fun setAssetUri(assetUri: Uri?): HlsMediaPlaylist.Interstitial.Builder!

Sets the asset URI.

Throws
java.lang.IllegalArgumentException

if called with a non-null value that is different to the value previously set.

setClientDefinedAttributes

@CanIgnoreReturnValue
fun setClientDefinedAttributes(
    clientDefinedAttributes: (Mutable)List<HlsMediaPlaylist.ClientDefinedAttribute!>!
): HlsMediaPlaylist.Interstitial.Builder!

Sets the client defined attributes.

Equal duplicates are ignored, new attributes are added to those already set.

Throws
java.lang.IllegalArgumentException

if called with a list containing a client defined attribute that is not equal with an attribute previously set with the same name.

setContentMayVary

@CanIgnoreReturnValue
fun setContentMayVary(contentMayVary: Boolean?): HlsMediaPlaylist.Interstitial.Builder!

Sets whether the content may vary between clients.

The default value is true .

Parameters
contentMayVary: Boolean?

Whether the content may vary.

Returns
HlsMediaPlaylist.Interstitial.Builder!

This builder.

Throws
java.lang.IllegalArgumentException

if attempting to change a value that is already set to a different value.

setCue

@CanIgnoreReturnValue
fun setCue(
    cue: (Mutable)List<@HlsMediaPlaylist.Interstitial.CueTriggerType String!>!
): HlsMediaPlaylist.Interstitial.Builder!

Sets the cue trigger types.

Throws
java.lang.IllegalArgumentException

if called with a value different to TIME_UNSET and different to the value previously set.

setDurationUs

@CanIgnoreReturnValue
fun setDurationUs(durationUs: Long): HlsMediaPlaylist.Interstitial.Builder!

Sets the duration, in microseconds.

Throws
java.lang.IllegalArgumentException

if called with a value different to TIME_UNSET and different to the value previously set.

setEndDateUnixUs

@CanIgnoreReturnValue
fun setEndDateUnixUs(endDateUnixUs: Long): HlsMediaPlaylist.Interstitial.Builder!

Sets the end date as a unix epoch timestamp, in microseconds.

Throws
java.lang.IllegalArgumentException

if called with a value different to TIME_UNSET and different to the value previously set.

setEndOnNext

@CanIgnoreReturnValue
fun setEndOnNext(endOnNext: Boolean): HlsMediaPlaylist.Interstitial.Builder!

Sets whether the interstitial ends on the start time of the next interstitial.

Once set to true, it can't be reset to false and doing so would be ignored.

setPlannedDurationUs

@CanIgnoreReturnValue
fun setPlannedDurationUs(plannedDurationUs: Long): HlsMediaPlaylist.Interstitial.Builder!

Sets the planned duration, in microseconds.

Throws
java.lang.IllegalArgumentException

if called with a value different to TIME_UNSET and different to the value previously set.

setPlayoutLimitUs

@CanIgnoreReturnValue
fun setPlayoutLimitUs(playoutLimitUs: Long): HlsMediaPlaylist.Interstitial.Builder!

Sets the play out limit, in microseconds.

Throws
java.lang.IllegalArgumentException

if called with a value different to TIME_UNSET and different to the value previously set.

setRestrictions

@CanIgnoreReturnValue
fun setRestrictions(
    restrictions: (Mutable)List<@HlsMediaPlaylist.Interstitial.NavigationRestriction String!>!
): HlsMediaPlaylist.Interstitial.Builder!

Sets the navigation restrictions.

Throws
java.lang.IllegalArgumentException

if called with a non-empty list of restrictions that is not equal to the non-empty list that was previously set.

setResumeOffsetUs

@CanIgnoreReturnValue
fun setResumeOffsetUs(resumeOffsetUs: Long): HlsMediaPlaylist.Interstitial.Builder!

Sets the resume offset, in microseconds.

Throws
java.lang.IllegalArgumentException

if called with a value different to TIME_UNSET and different to the value previously set.

setSnapTypes

@CanIgnoreReturnValue
fun setSnapTypes(
    snapTypes: (Mutable)List<@HlsMediaPlaylist.Interstitial.SnapType String!>!
): HlsMediaPlaylist.Interstitial.Builder!

Sets the snap types.

Throws
java.lang.IllegalArgumentException

if called with a non-empty list of snap types that is not equal to the non-empty list that was previously set.

setStartDateUnixUs

@CanIgnoreReturnValue
fun setStartDateUnixUs(startDateUnixUs: Long): HlsMediaPlaylist.Interstitial.Builder!

Sets the start date as a unix epoch timestamp, in microseconds.

Throws
java.lang.IllegalArgumentException

if called with a value different to TIME_UNSET and different to the value previously set.

setTimelineOccupies

@CanIgnoreReturnValue
fun setTimelineOccupies(
    @HlsMediaPlaylist.Interstitial.TimelineOccupiesType timelineOccupies: @HlsMediaPlaylist.Interstitial.TimelineOccupiesType String?
): HlsMediaPlaylist.Interstitial.Builder!

Sets the timeline occupies type.

The default value is TIMELINE_OCCUPIES_POINT.

Throws
java.lang.IllegalArgumentException

if attempting to change a value that is already set to a different value.

setTimelineStyle

@CanIgnoreReturnValue
fun setTimelineStyle(
    @HlsMediaPlaylist.Interstitial.TimelineStyleType timelineStyle: @HlsMediaPlaylist.Interstitial.TimelineStyleType String?
): HlsMediaPlaylist.Interstitial.Builder!

Sets the timeline style type. The default value is TIMELINE_STYLE_HIGHLIGHT.

Throws
java.lang.IllegalArgumentException

if attempting to change from a non-default value to a different non-default value.