AudioTimeline

interface AudioTimeline

An AudioTimeline represents the playback order of the audio publication content.

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

An AudioTimeline is played using a ColibrioAudioPlayer.

AudioTimeline instances are created from AudioPublication instances. For example: WpAudioPublication.createAudioTimeline

Segment lengths

A segment whose audio length the publication does not state has SyncMediaSegmentData.durationType until the length is measured. A measured segment has SyncMediaSegmentDurationType.FIXED. FIXED means that the length is known. It does not mean that the length is exact. For example, the length of an MP3 file with a variable bitrate can be an estimate. A segment has audio when its SyncMediaSegmentData.refs contain a SyncMediaAudioRef.

The framework measures lengths at these points:

While the length of any segment with audio is unknown, approximateDurationMs counts only the known lengths. OnMediaPlayerEventListener.onSegmentDurationChanged reports each length that ColibrioAudioPlayer.reload or playback measures or corrects. The lengths that AudioReadingSystemEngine.createAudioPlayer measures reach no listener, because the call measures them before you can add a listener. OnMediaPlayerEventListener.onError describes the same limit for errors. Read these lengths from segments and approximateDurationMs after the call has returned.

Properties

Link copied to clipboard

The approximate total duration of the timeline in milliseconds. It is the sum of the known segment lengths.

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

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

Functions

Link copied to clipboard

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

Link copied to clipboard

Returns the navigation item references related to the specified timeline position.

Link copied to clipboard

Find the SyncMediaTimelinePositionData that most closely corresponds to a PublicationNavigationItem.

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.