-
- All Implemented Interfaces:
-
com.brightcove.player.event.Component
,com.brightcove.ssai.player.PlaybackListener
,com.brightcove.ssai.timeline.ticker.TickerObserver
@Emits(events = {EventType.SEEK_TO})@ListensFor(events = {SSAIEventType.SKIP_AD}) public class TimelineManager extends AbstractComponent implements TickerObserver, PlaybackListener
Manages the state of the Timeline according to player playhead position.
-
-
Field Summary
Fields Modifier and Type Field Description private SeekListener
seekListener
-
Constructor Summary
Constructors Constructor Description TimelineManager(BaseVideoView mBaseVideoView, Timeline mTimeline)
-
Method Summary
Modifier and Type Method Description SeekListener
getSeekListener()
long
getCurrentAbsolutePlayheadPosition()
Gets current absolute playhead position. long
getCurrentRelativeDuration()
Gets current relative duration. long
getCurrentRelativePlayheadPosition()
Gets current relative playhead position. boolean
isPlayingAd()
Checks if an ad is currently being played. long
getContentLength()
Gets the content length. long
getTotalLength()
Gets the total length. AdPod
getPlayingAdPod()
Returns an AdPod if it's currently playing an Ad,otherwise returns null. Ad
getPlayingAd()
Timeline
getTimeline()
Gets the timeline if available. void
onTick(long lastPlayheadPositionMillis, long currentPlayheadPositionMillis)
A tick represent an poll from the underlying video player. boolean
addAdPodListener(@NonNull() AdPodListener adPodListener)
Adds the Ad pod listener. boolean
removeAdPodListener(@NonNull() AdPodListener adPodListener)
Removes the Ad pod listener. void
removeAllAdPodListeners()
Removed all Ad pod listeners. void
onPlay(long playheadPosition)
Indicates a play event. void
onPause(long playheadPosition)
Indicates a pause event. void
onComplete(long duration)
Indicates when the video playback has completed. void
reset()
-
-
Constructor Detail
-
TimelineManager
TimelineManager(BaseVideoView mBaseVideoView, Timeline mTimeline)
-
-
Method Detail
-
getSeekListener
SeekListener getSeekListener()
-
getCurrentAbsolutePlayheadPosition
long getCurrentAbsolutePlayheadPosition()
Gets current absolute playhead position.
-
getCurrentRelativeDuration
long getCurrentRelativeDuration()
Gets current relative duration.
-
getCurrentRelativePlayheadPosition
long getCurrentRelativePlayheadPosition()
Gets current relative playhead position.
-
isPlayingAd
boolean isPlayingAd()
Checks if an ad is currently being played.
-
getContentLength
long getContentLength()
Gets the content length.
-
getTotalLength
long getTotalLength()
Gets the total length.
-
getPlayingAdPod
@Nullable() AdPod getPlayingAdPod()
Returns an AdPod if it's currently playing an Ad,otherwise returns null.
-
getPlayingAd
@Nullable() Ad getPlayingAd()
-
getTimeline
@NonNull() Timeline getTimeline()
Gets the timeline if available.
-
onTick
void onTick(long lastPlayheadPositionMillis, long currentPlayheadPositionMillis)
A tick represent an poll from the underlying video player.
- Parameters:
lastPlayheadPositionMillis
- the last playhead position in millisecondscurrentPlayheadPositionMillis
- the current playhead position in milliseconds
-
addAdPodListener
boolean addAdPodListener(@NonNull() AdPodListener adPodListener)
Adds the Ad pod listener.
- Parameters:
adPodListener
- the Ad pod listener
-
removeAdPodListener
boolean removeAdPodListener(@NonNull() AdPodListener adPodListener)
Removes the Ad pod listener.
- Parameters:
adPodListener
- the Ad pod listener
-
removeAllAdPodListeners
void removeAllAdPodListeners()
Removed all Ad pod listeners.
-
onPlay
void onPlay(long playheadPosition)
Indicates a play event.
- Parameters:
playheadPosition
- the playhead position
-
onPause
void onPause(long playheadPosition)
Indicates a pause event.
- Parameters:
playheadPosition
- the playhead position
-
onComplete
void onComplete(long duration)
Indicates when the video playback has completed.
- Parameters:
duration
- the duration
-
reset
void reset()
-
-
-
-