Subscriber
Subscriber receives the active player, song, lyrics, playback state, and display options from Lyricon. It is intended for third-party apps that need to read Lyricon data.
Flow
- Add the Subscriber dependency.
- Create a
LyriconSubscriber. - Register connection listeners.
- Call
subscribeActivePlayer(). - Call
register(). - Call
unregister()ordestroy()when it is no longer needed.
Dependency
kotlin
implementation("io.github.proify.lyricon:subscriber:0.1.70")Minimal Example
kotlin
val subscriber = LyriconFactory.createSubscriber(context)
subscriber.subscribeActivePlayer(object : SimpleActivePlayerListener {
override fun onSongChanged(song: Song?) {
}
})
subscriber.register()