lovegaoshi / KotlinAudio

KotlinAudio is an Android audio player written in Kotlin, making it simpler to work with audio playback from streams and files.
Apache License 2.0
0 stars 2 forks source link

[feat] crossfade #13

Open lovegaoshi opened 1 year ago

lovegaoshi commented 1 year ago
  1. make 2 exoplayers that switch
  2. whenever exoplayers switch, recreate notificationManager
  3. make a button to simply switch exoplayer. this should be seamless because exoplayers should not be stopped.
  4. if notificationMnager is not flickering and not stopping playback, on switch set the other exoplayer to "the next song" and add in fade in/out, acutally for now just stop volume is fine
  5. hope nothing crushes
lovegaoshi commented 1 year ago

this abomination actually meets 3 i dont think it flickers, onward to implement 4

lovegaoshi commented 1 year ago

to make this actually useable in APM (which handles queue outside of RNTP) I would rather make crossfade switch manually instaed of automatically. its also partly i dont know how to add listeners in kotlin. manually doing this also means if not handled then RNTP will behave exactly as crossfade is not implemented, just plus the exoplayer2 initialization cost.

The two exoplayers inside kotlinaudio will have the exact same queue. its up to me to specify what should be played.

the first KA commit is still necessary because there can only be one exoplayer "in focus" thus the whole currentPlayer() setup is needed.

this feels like a giant mess but hopefully by keeping both exoplayers ahving the same queue, QueuedAudioPlayer will still function normally.