Pre-Proposal for BrainzPlayer and ListenBrainz Integration
This project aims to seamlessly integrate BrainzPlayer with ListenBrainz’s “Listening Now” feature to enhance the overall listening experience. By addressing current bugs and implementing playback control for Spotify and on-device players, the goal is to provide accurate and dynamic song status updates
Currently, I have identified the following scenarios and my approach to address them:
- Song is being played by the ListenBrainz app using BrainzPlayer:
In this case, the player will display the state of this song exclusively. Playback and queue management can be fully supported here. - Song is being played by any on-device music player:
If a user isn’t using BrainzPlayer but is playing a song through another app (configured in settings), playback control can be managed using Media Sessions. - Playing songs on external devices:
When a user opts to listen through an external device, the “Listening Now” state from the ListenBrainz server will be shown using WebSockets. Playback control will be possible if the user is using Spotify.
Spotify Integration
Spotify’s Android SDK provides two key libraries:
- App Remote Library: Useful for controlling Spotify app playback.
- Authorization Library: Helps obtain a user access token for interacting with Spotify Web API.
Using the Spotify Web API, I can:
- Fetch and display the currently playing queue.
- Add tracks to the queue.
- Fetch and export playlists from Spotify and ListenBrainz.
YouTube Data API
The YouTube Data API can be leveraged to:
- Search for songs, fetch playlists, and retrieve metadata.
- However, it doesn’t offer direct playback control, limiting our ability to support queuing.
Additional Features
- Playback Control via Media Sessions:
I aim to enhance the app’s capability to control playback from players like YouTube Music and others. Currently, we only send listens, but by utilizing Media Sessions, we can display the song in our mini-player and control basic playback (play, pause, seek, progress).
- Note: Queuing won’t be possible for these players.
- Delete Unwanted Listens:
Users often accumulate unwanted listens, like podcasts from Spotify or standard YouTube videos. I plan to introduce an option for users to delete these listens to maintain a more accurate listening history.
Summary of Deliverables:
- Integration of BrainzPlayer with ListenBrainz’s “Listening Now” state.
- Fix all bugs related to BrainzPlayer and revamp the UI.
- Spotify integration for remote playback control and queue management.
- Support for fetching playlists and song metadata using the YouTube Data API.
- Playback control of on-device players through Media Sessions.
- Feature to delete unwanted listens for better listening history management.