createSyncMediaPlayer

abstract suspend fun createSyncMediaPlayer(timeline: SyncMediaTimeline, options: SyncMediaPlayerCreateOptions = SyncMediaPlayerCreateOptions()): ColibrioResult<SyncMediaPlayer>

Creates a new SyncMediaPlayer. Use for playing synchronized media such as EPUB Media Overlays or TTS (Text-To-Speech). You can create SyncMediaTimeline instances from publications using the format specific ReaderPublication instances. For example EpubReaderPublication.createMediaOverlaySyncMediaTimeline() or PdfReaderPublication.createTtsSyncMediaTimeline()`.

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).

The SyncMediaPlayer can playback audio content using either a WebView audio player or a native audio player. By default the SyncMediaPlayer will use a WebView audio player. See SyncMediaPlayerCreateOptions.audioRenderer for information on how to configure this.


abstract suspend fun createSyncMediaPlayer(colibrioAudioPlayer: ColibrioAudioPlayer): ColibrioResult<SyncMediaPlayer>

Creates a new SyncMediaPlayer from an existing ColibrioAudioPlayer.

Use this to reconnect the ReaderView with your audio player using ReaderView.setSyncMediaPlayer.