The main purpose of custom ad markers is to enable you to pass on to the PSDK a set of TimeRange specifications that represent timeline segments.
Each TimeRange specification in the set represents a segment on the playback timeline (maintained internally by the PSDK) that must be marked appropriately as an ad-related period.
The TimeRange class is a simple data structure that exposes two read-only properties, the start position and the end position on the timeline, which abstracts the idea of a time range inside the playback timeline. Both values are expressed in milliseconds. Here is a summary of the TimeRange class:
public final class TimeRange {
// the start/end values are provided at construction time
public static TimeRange createRange(long begin, long duration) {...}
// only getters are available
public long getBegin() {...}
public long getEnd() {...}
public long getDuration() {...}
}