enricocid / Music-Player-GO

🎢🎼 Very slim music player πŸ‘¨β€πŸŽ€ 100% made in Italy πŸ•πŸŒ³πŸŒžπŸπŸŒ„

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FR]: Move to Media3 ExoPlayer

enricocid opened this issue Β· comments

What feature would you like to see?

  • Use ExoPlayer in place of Media player
  • Use MediaItems to build queue and finally implement playlists #132
  • Let ExoPlayer alone deal with playlists skipping and audio focus
  • Take advantage of MediaItem
  • Simplify Music model. The idea is to maintain few fields (id, albumid, startFrom?) and use MediaItem metadata in the UI.
  • Improve formats support(?)
  • How to implement reliable playlists? They should update when files are moved or deleted to update media id. There should be a method to update the database entries running a MediaStore query.

This will greatly simplify/improve MediaPlayerHolder.

https://developer.android.com/codelabs/exoplayer-intro#0

What kind of level is this feature request?

Advanced, a nightmare!

More info

New MediaPlayerHolder architecture/logics and a database to manage playlists and saved songs. That's why it is nightmare.
Implementation of ExoPlayer is pretty simple.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Use MediaItems to build queue and finally implement playlists
#132

I think you might be misunderstanding what ExoPlayer means by playlists. It's really their way of saying "queue". You still need a DB to make actual playlists.

This is also tangentially related, but you can leverage the queue system to implement gapless playback too. Apparently this is an intrinsic behavior that is always attempted if you have a queue of media items in the player. It's something I've wanted to implement for awhile but the nature of translating between player and app state is really annoying.

How to implement reliable playlists? They should update when files are moved or deleted to update media id. There should be a method to update the database entries running a MediaStore query.

I personally use an ID system (not MediaStore IDs, those are inconsistent) to persist music.

Improve formats support(?)

ExoPlayer has really similar format support to native, aside from the addition of a few obscure formats. You also have to use extensions to get certain formats like FLAC working <Oreo.

Simplify Music model. The idea is to maintain few fields (id, albumid, startFrom?) and use MediaItem metadata in the UI.

ExoPlayer's metadata extractor is asynchronous and really slow. You probably need to keep a complex Music model and populate it with the extracted metadata during loads.

Also, Media3 the MediaSession extension is awful. Apparently there are a ton of performance issues and gotchas because of the library's incessant desire to be hElpfUl and automate behavior that should really be handled by the app devs. I would seriously recommended rolling your own MediaSessionCompat controller and just using ExoPlayer components like I do.