CuesWithTimingSubtitle


@UnstableApi
public final class CuesWithTimingSubtitle implements Subtitle


A Subtitle backed by a list of CuesWithTiming instances.

Summary

Public constructors

Public methods

ImmutableList<Cue>
getCues(long timeUs)

Retrieve the cues that should be displayed at a given time.

long
getEventTime(int index)

Returns the event time at a specified index.

int

Returns the number of event times, where events are defined as points in time at which the cues returned by getCues changes.

int
getNextEventTimeIndex(long timeUs)

Returns the index of the first event that occurs after a given time (exclusive).

Public constructors

CuesWithTimingSubtitle

public CuesWithTimingSubtitle(List<CuesWithTiming> cuesWithTimingList)

Public methods

getCues

public ImmutableList<CuegetCues(long timeUs)

Retrieve the cues that should be displayed at a given time.

Parameters
long timeUs

The time in microseconds.

Returns
ImmutableList<Cue>

A list of cues that should be displayed, possibly empty.

getEventTime

public long getEventTime(int index)

Returns the event time at a specified index.

Parameters
int index

The index of the event time to obtain.

Returns
long

The event time in microseconds.

getEventTimeCount

public int getEventTimeCount()

Returns the number of event times, where events are defined as points in time at which the cues returned by getCues changes.

Returns
int

The number of event times.

getNextEventTimeIndex

public int getNextEventTimeIndex(long timeUs)

Returns the index of the first event that occurs after a given time (exclusive).

Parameters
long timeUs

The time in microseconds.

Returns
int

The index of the next event, or INDEX_UNSET if there are no events after the specified time.