Colibrio Media Service
This is the entry point for the Colibrio background audio playback services.
To be able to use the ColibrioMediaService, you need to modify your AndroidManifest.xml file: Add the following permission:
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
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:exported="true"
android:foregroundServiceType="mediaPlayback">
<intent-filter>
<action android:name="android.media.browse.MediaBrowserService" />
</intent-filter>
</service>
You must call ColibrioMediaService.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.
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 ColibrioMediaService with the passed application context of the given context.
Properties
If the ColibrioMediaService has been initialized using ColibrioMediaService.initialize.