feat(audio): migrate AudioService to MediaLibraryService#3513
feat(audio): migrate AudioService to MediaLibraryService#3513AhmedGamal92 wants to merge 2 commits intoquran:mainfrom
Conversation
Migrates the `AudioService` from the legacy `Service` to `androidx.media3.session.MediaLibraryService`. This change introduces `MediaLibrarySession` to handle media playback, replacing parts of the older `MediaSessionCompat` implementation. A new `QuranServiceCallback` class is also added for future integration with media controllers like Android Auto.
|
@ahmedre
|
|
wa3laikum alsalam - jazakumAllah khairan for the pr! |
|
|
looks good to me, جزاكم الله خيراً minor points:
can you try to test media buttons to make sure they still work (if you have headphones that can pause/resume playback etc)? |
app/src/main/java/com/quran/labs/androidquran/service/AudioService.kt
Outdated
Show resolved
Hide resolved
@ahmedre pushed a commit getting rid of the serviceHandler as discussed earlier, please check now |
|
wa3laikum alsalam wa ra7matullah,
|
|
|
Upgraded Dependencies |
True, good catch, we should cleanup the mediaSessionCompat, the MediaLibraryService should handle that for us, updating the PR soon. |
Migrates the
AudioServicefrom the legacyServicetoandroidx.media3.session.MediaLibraryService.This change introduces
MediaLibrarySessionto handle media playback, replacing parts of the olderMediaSessionCompatimplementation. A newQuranServiceCallbackclass is also added for future integration with media controllers like Android Auto.The motivation behind this migration is to build on top of it to enable a better android auto support (check the issue #1086), the end goal is to use the same audio service to sync the player items (surahs) and playback state with android auto, similar to other media playback apps.