-
public interface Timeline
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
Timeline.Type
The Timeline Type.
-
Method Summary
Modifier and Type Method Description abstract void
setType(Timeline.Type type)
abstract Timeline.Type
getType()
Gets the Timeline type. abstract long
getContentDuration()
It returns the content duration. abstract long
getStreamDuration()
It returns the total duration of the video.It includes the duration of the content plus the duration of thestitched Ads. abstract long
getContentPosition(long absolutePosition)
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. abstract long
getStreamPosition(long contentPosition)
Converts the content position to its absolute position. abstract List<Ad>
getAds()
Returns the list of Ads in the media itemImportant: In DAI, Google does not give the list of all ads that will be stitched in thevideo. abstract boolean
isAdPlaying()
Returns if an ad is playing abstract void
setAdIsPlaying(boolean isAdPlaying)
Sets if an ad is playing abstract void
addAd(Ad ad)
Ads a new ad to the Timeline abstract Ad
getCurrentAdPlaying()
Gets the current ad played abstract void
setCurrentAdPlaying(Ad ad)
Sets the ad that is currently being played abstract void
setCuePoints(List<CuePoint> cuePoints)
Sets the list of cue points to the Timeline abstract double
getTotalAdsDuration()
Returns the total duration of all the adsstitched in the stream abstract CuePoint
isCuePointCrossed(long position)
Checks if the given position crossed a cue point void
reset()
Resets this timeline to its default initial value. -
-
Method Detail
-
setType
abstract void setType(Timeline.Type type)
-
getType
abstract Timeline.Type getType()
Gets the Timeline type.
-
getContentDuration
abstract long getContentDuration()
It returns the content duration. Also known as relative duration.This is the duration of the original content without the duration of thestitched Ads.
-
getStreamDuration
abstract long getStreamDuration()
It returns the total duration of the video.It includes the duration of the content plus the duration of thestitched Ads.
-
getContentPosition
abstract long getContentPosition(long absolutePosition)
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.
- Parameters:
absolutePosition
- the absolute position in milliseconds.
-
getStreamPosition
abstract long getStreamPosition(long contentPosition)
Converts the content position to its absolute position.
- Parameters:
contentPosition
- the relative content playhead position in milliseconds.
-
getAds
abstract List<Ad> getAds()
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 thevideo. It gives one by one once it is its turn to be played.
This method will return only the ads that were already played.
-
isAdPlaying
abstract boolean isAdPlaying()
Returns if an ad is playing
-
setAdIsPlaying
abstract void setAdIsPlaying(boolean isAdPlaying)
Sets if an ad is playing
-
getCurrentAdPlaying
abstract Ad getCurrentAdPlaying()
Gets the current ad played
-
setCurrentAdPlaying
abstract void setCurrentAdPlaying(Ad ad)
Sets the ad that is currently being played
-
setCuePoints
abstract void setCuePoints(List<CuePoint> cuePoints)
Sets the list of cue points to the Timeline
-
getTotalAdsDuration
abstract double getTotalAdsDuration()
Returns the total duration of all the adsstitched in the stream
-
isCuePointCrossed
abstract CuePoint isCuePointCrossed(long position)
Checks if the given position crossed a cue point
- Parameters:
position
- - A position to check against
-
reset
void reset()
Resets this timeline to its default initial value.
Note: The default implementation does nothing. It can be overridden to provide thedesired implementation.
-
-
-
-