jrfeng / snow

Android music player framework, compatible with MediaSession. Support custom music player (MediaPlayer, ExoPlayer), custom Notification, custom audio effect engine, only WiFi network, sound quality/dynamic URL, headset clicks, sleep timer, playback history, player state persistence.
MIT License
190 stars 45 forks source link

STATE_BUFFERING update when play start #31

Closed webwayscript closed 2 years ago

webwayscript commented 2 years ago

Today i download latest code from github. PlaybackStateCompat.STATE_BUFFERING updating after playing it must update when buffering start. PlaybackStateCompat.STATE_PLAYING and PlaybackStateCompat.STATE_BUFFERING showing same time it was working fine before . my code is

   testMediaSession(playerClient.getMediaController());

     public void testMediaSession(MediaControllerCompat mediaController) {
    mediaController.registerCallback(new MediaControllerCompat.Callback() {
        @Override
        public void onPlaybackStateChanged(PlaybackStateCompat state) {
            switch (state.getState()) {
                case PlaybackStateCompat.STATE_BUFFERING:
                    Log.e(TAG, "STATE_BUFFERING");
                    break;

or i must use playerClient.addOnPlaybackStateChangeListener? and playerClient.addOnBufferedProgressChangeListener();?

webwayscript commented 2 years ago

Its fixed new update