Previous Track button |<

I have a BlueTooth media controller I built myself with an Adafruit Feather. All the controls work fine except I can’t backup to the prior track in the queue. Since that works in music players, I thought maybe I was sending a different media keycode than AntennaPod was listening for. It’s not. I’m sending a KEYCODE_MEDIA_PREVIOUS, but I can see in the GitHub that this performs the same action as KEYCODE_MEDIA_REWIND.

My question is, shouldn’t the behavior for KEYCODE_MEDIA_PREVIOUS be to call mediaPlayer.skipToPrevious() ? (assuming the options are set to get to else) The comment is actually false; I don’t want to rewind when I select prev track. Fair warning that I’m not a Java dev, and I have no idea what impacts this might occur.

Kind regards to all who contribute to this fine project.

//Line #672 in package de.danoeh.antennapod.core.service.playback;

    case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
        if (getStatus() != PlayerStatus.PLAYING && getStatus() != PlayerStatus.PAUSED) {
            return false;
        } else if (UserPreferences.shouldHardwarePreviousButtonRestart()) {
            // user wants to restart current episode
            mediaPlayer.seekTo(0);
        } else {
            //  user wants to rewind current episode
            mediaPlayer.seekDelta(-UserPreferences.getRewindSecs() * 1000);
        }
        return true;
    case KeyEvent.KEYCODE_MEDIA_REWIND:
        if (getStatus() == PlayerStatus.PLAYING || getStatus() == PlayerStatus.PAUSED) {
            mediaPlayer.seekDelta(-UserPreferences.getRewindSecs() * 1000);
        } else {
            return false;
        }
        return true;
2 Likes