Options
All
  • Public
  • Public/Protected
  • All
Menu

A SyncMediaTimeline is created by calling any of the createSyncMediaTimeline() methods on a ReaderPublication. Each publication format supports different sync media formats. EPUB supports Media Overlays as well as content block based TTS, whereas PDF only supports content block based TTS. For example: EpubReaderPublication.createMediaOverlaySyncMediaTimeline() or EpubReaderPublication.createTtsSyncMediaTimeline()

The SyncMediaTimeline contains a list of segments that should be played in order. Each segment contains references to media objects that should be played in parallel.

The SyncMediaTimeline also contains methods for mapping between SyncMediaTimelinePositions and ContentLocations. This feature allows the reading system to synchronize SyncMedia playback with visible publication content such as automatic page turning and highlighting of narrated content.

Hierarchy

  • ISyncMediaTimeline

Index

Methods

createDefaultMediaObjectRenderers

  • Create the default set of media object renderers required for playing all content types in this timeline.

    Returns ISyncMediaObjectRenderer[]

fetchContentLocation

fetchTimelinePosition

fetchTimelineRange

getApproximateDurationMs

  • getApproximateDurationMs(): number
  • Gets the total duration of the timeline in milliseconds.

    It is possible that the duration is updated during runtime as media is loaded and more information is available. If this happens, a syncMediaSegmentDurationChanged engine event will fire after the duration has been updated.

    Returns number

getApproximateOffsetMs

  • Get the approximate offsetMs into the timeline from an ISyncMediaTimelinePosition.

    Parameters

    Returns number

getMediaObjectRefTypes

  • getMediaObjectRefTypes(): string[]
  • Get a list of all SyncMediaObjectRef types that MAY be present in this timeline.

    Returns string[]

getMediaObjects

getReaderPublication

getResourceProvider

  • Get the ResourceProvider instance that is used for fetching media object resources.

    Returns IResourceProvider

getSegments

  • Get all segments in the timeline defining the playback order of media objects.

    Returns readonly ISyncMediaSegment[]

getSyncMediaFormat

getTimelinePositionFromApproximateOffsetMs

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

    Parameters

    • approximateOffsetMs: number

      Milliseconds into the timeline.

    Returns ISyncMediaTimelinePosition

toJSON

Generated using TypeDoc