Timeline

interface Timeline

Types

Link copied to clipboard
enum Type
The Timeline Type.

Functions

Link copied to clipboard
abstract fun addAd(ad: Ad)
Ads a new ad to the Timeline
Link copied to clipboard
abstract fun getAds(): List<Ad>
Returns the list of Ads in the media item Important: In DAI, Google does not give the list of all ads that will be stitched in the video.
Link copied to clipboard
abstract fun getContentDuration(): Long
It returns the content duration.
Link copied to clipboard
abstract fun getContentPosition(absolutePosition: Long): Long
Calculates the corresponding content playhead position given the absolute playhead position, that is, the playhead position as if there were no Ads stitched to the content.
Link copied to clipboard
abstract fun getCurrentAdPlaying(): Ad
Gets the current ad played
Link copied to clipboard
abstract fun getStreamDuration(): Long
It returns the total duration of the video.
Link copied to clipboard
abstract fun getStreamPosition(contentPosition: Long): Long
Converts the content position to its absolute position.
Link copied to clipboard
abstract fun getTotalAdsDuration(): Double
Returns the total duration of all the ads stitched in the stream
Link copied to clipboard
abstract fun getType(): Timeline.Type
Gets the Timeline type.
Link copied to clipboard
abstract fun isAdPlaying(): Boolean
Returns if an ad is playing
Link copied to clipboard
abstract fun isCuePointCrossed(position: Long): CuePoint
Checks if the given position crossed a cue point
Link copied to clipboard
open fun reset()
Resets this timeline to its default initial value.
Link copied to clipboard
abstract fun setAdIsPlaying(isAdPlaying: Boolean)
Sets if an ad is playing
Link copied to clipboard
abstract fun setCuePoints(cuePoints: List<CuePoint>)
Sets the list of cue points to the Timeline
Link copied to clipboard
abstract fun setCurrentAdPlaying(ad: Ad)
Sets the ad that is currently being played
Link copied to clipboard
abstract fun setType(type: Timeline.Type)