A Music Player built with Jetpack compose and media3/Exoplayer
- Load/Play Songs from External/Shared Storage
- Foreground Service to play the music, when the app is in Background.
- Recommended Music Player Lifecycle Handling
- MediaSessions from Jetpack Media3 artifact.
- Styled Notification for music playback control.
This Music Player integrates with PlayerNotificationManager from ExoPlayer to provide a seamless music playback experience and manage notifications for music control. Here's how it works using Media3 Android API:
-
Notification Channel Setup: Before displaying any notifications, a notification channel is created using the NotificationManager. This channel is essential for managing and customizing notifications for the music player.
-
MediaStyle Notification: The Music Player utilizes MediaStyle notifications, which provide a rich interface for controlling music playback, including play, pause, skip, and stop actions. These notifications are designed to be interactive and offer a consistent user experience across different Android versions.
-
Updating Notification: As the playback state changes (e.g., song changes, play/pause actions), the Music Player updates the notification to reflect the current playback status. This ensures that users can always see the current song information and control playback without needing to open the app.
-
Foreground Service: The music playback functionality runs as a foreground service, ensuring that the system prioritizes its execution, even when memory is low or the device is under heavy load. This allows the music player to continue playing music seamlessly in the background while users interact with other apps or the device.
- PlayList
- Favourites/Liked Songs
- Detailing Mini Player to Different Screen
- Kotlin
- Jetpack Compose
- Koin for Dependency Injection
- Glide/Coil for Image Loading/Showing
- Exoplayer etc.,
Connect with me for more like this https://www.linkedin.com/in/myofficework/