SyncMediaTimeline

A SyncMediaTimeline describes arbitrary media (such as audio or video) and how to synchronize them with the publication content.

The timeline contains a list of segments defining the playback order of mediaObjects.

A SyncMediaTimeline is played using a SyncMediaPlayer.

SyncMediaTimeline instances are created from ReaderPublication instances. For example: EpubReaderPublication.createMediaOverlaySyncMediaTimeline

Functions

Link copied to clipboard
abstract fun fetchLocator(position: SyncMediaTimelinePositionData, onSuccess: (SimpleLocatorData) -> Unit, onError: (ColibrioException) -> Unit)

Find the locator that most closely corresponds to the timeline position.

Link copied to clipboard

Find the SyncMediaTimelinePositionData that most closely corresponds to a locator.

Link copied to clipboard
abstract fun fetchTimelineRange(locator: SimpleLocatorData, onSuccess: (SyncMediaTimelineRangeData) -> Unit, onError: (ColibrioException) -> Unit)

Find the timeline range that most closely corresponds to a range Locator.

Link copied to clipboard

Get the approximate offset into the timeline in milliseconds from a timeline position object.

Get the timeline position that most closely matches an offset into the timeline. If the offset is negative, the position at the start of the timeline will be returned. If the offset is larger than the duration of the timeline, the position at the end of the timeline will be returned.

Properties

Link copied to clipboard

Returns the approximate total duration of the timeline in milliseconds. This value may be updated during playback as media is loaded and more information becomes available. When updated, OnSyncMediaPlayerEventListener.onSegmentDurationChanged will be called.

Link copied to clipboard

The media objects, such as audio and video resources, used by this timeline. Media objects are referenced by SyncMediaSegments

Link copied to clipboard

The base URL of the ReaderPublication this timeline was created from. This value will match ReaderPublication.defaultLocatorUrl.

Link copied to clipboard

All segments in the timeline defining the playback order of mediaObjects.

Link copied to clipboard

The source sync media format this timeline was built from.

Link copied to clipboard

Represents the SyncMediaTimeline in a serializable format.