Sync Media Player
Used for playing synchronized media such as EPUB Media Overlays or TTS (Text-To-Speech).
Create a new player by calling ReadingSystemEngine.createSyncMediaPlayer with a SyncMediaTimeline.
The actual rendering of media such as audio or video are performed by SyncMediaObjectRenderers. These are currently not exposed in this API.
A SyncMediaPlayer can be attached to a ReaderView by assigning the player to ReaderView.syncMediaPlayer. When a SyncMediaPlayer is attached to a ReaderView, they are able to synchronize positions and enable features such as text highlighting (if the synchronized media format supports it).
Properties
Gets the approximate elapsed time from timeline start to current position in milliseconds.
Gets the approximate elapsed time from timeline start to current position in milliseconds.
Gets/sets the options related to how the SyncMediaPlayer automatically synchronizes with the ReaderView. Disable managed synchronization by setting SyncMediaManagedReaderViewSynchronizationOptions.enabled to false.
The current active playback range, previously set with setPlaybackRange. Or null if there is no active playback range.
Gets/sets the playback rate. This must be a value between 0.25 and 5.0, where 1.0 is "normal speed". Values lower than 1.0 make the media play slower than normal, higher values make it play faster.
Gets/sets the synchronization wait behavior for the SyncMediaPlayer when it is attached to a ReaderView. See SyncMediaReaderViewSynchronizationWaitBehavior for a description on how each mode works.
SyncMediaTimeline instance used to create this player.
The current timeline position of the player
Returns true if the player is waiting for SyncMediaObjectRenderers to load data. (SyncMediaObjectRenderers are currently not exposed in this API.)
Returns true if the player is waiting to become synchronized with the ReaderView.
Functions
Adds an instance of OnSyncMediaPlayerEventListener to the player. It will produce events with information about the playback state.
Adds an instance of OnSyncMediaRangeEventListener to the player. It will produce events with information about the playback range.
Attempts to synchronize the player with the ReaderView using the given method.
Removes an instance of OnSyncMediaPlayerEventListener from the player.
Removes an instance of OnSyncMediaRangeEventListener from the player.
If the SyncMediaPlayer has an active playback range, it will be removed, and the engine event OnSyncMediaRangeEventListener.onPlaybackRangeRemoved will be emitted by the reading system. The event object's reason
property will be set to SyncMediaRangePlaybackRemoveReason.APP_GENERATED.
Seek to the approximate time from timeline start in milliseconds.
Seeks to the next segment in the timeline, if such segment exists.
Seeks to the previous segment in the timeline, if such segment exists.
Seeks to a position in the timeline.
Sets a new active playback range on this SyncMediaPlayer, and by default, immediately seeks to range.start
.