AudioReadingSystemEngine
This is the entry point for the Colibrio background audio playback services.
To be able to use the AudioReadingSystemEngine, you need to modify your AndroidManifest.xml file: Add the following permissions:
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
Inside the <application>
tag add the following:
<receiver
android:name="androidx.media.session.MediaButtonReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
<service
android:name="com.colibrio.readingsystem.audio.service.ColibrioMediaBrowserService"
android:enabled="true"
android:exported="true"
android:foregroundServiceType="mediaPlayback"
tools:ignore="ExportedService">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
</intent-filter>
</service>
You must call AudioReadingSystemEngine.initialize before using the service to create your audio player. We recommend that you call it in onCreate
in your application class or your main activity.
Properties
The currently active ColibrioAudioPlayer instance if one has been created.
True while AudioReadingSystemEngine is trying to create a new ColibrioAudioPlayer but have not yet finished.
If the AudioReadingSystemEngine has been initialized using AudioReadingSystemEngine.initialize.
Functions
Creates a new ColibrioAudioPlayer using the provided load configuration. If there is an existing ColibrioAudioPlayer, it will be destroyed.
Destroys the active ColibrioAudioPlayer instance, which results in ignoring all subsequent calls to its methods. This method does nothing if there is no active audio player.
Initializes AudioReadingSystemEngine with the passed application context of the given context.
Load the Media Overlay from an EPUB. Use the returned EpubAudioPublication to playback the Media Overlay with the ColibrioAudioPlayer.
Load a W3C Audiobooks publication. Use the returned WpAudioPublication instance to extract metadata and create a AudioTimeline used for playback.