brahmkshatriya / echo

An extension based Android Music Player.
Other
231 stars 13 forks source link

fix: onMediaItem called twice #12

Closed rebelonion closed 1 month ago

rebelonion commented 1 month ago

onMediaItemTransition was causing startedPlaying, etc to be run twice because onMediaItemTransition is also called by exoplayer when the playlist changes (Player.MEDIA_ITEM_TRANSITION_REASON_PLAYLIST_CHANGED).

onTracksChanged is only called once when the track is loaded or unloaded. I moved stoppedPlaying up to the top so it can be called when the track is removed also.

brahmkshatriya commented 1 month ago

I am literally reworking the whole thing 😭