Bugfixes
- Skipping an episode did not work - pauseOnHeadsetDisconnect preference was not updated correctly
This commit is contained in:
parent
ff285c5ad5
commit
8e05212c75
|
@ -319,7 +319,9 @@ public class UserPreferences implements
|
|||
PREF_PLAYBACK_SPEED_ARRAY, null));
|
||||
} else if (key.equals(PREF_PAUSE_PLAYBACK_FOR_FOCUS_LOSS)) {
|
||||
pauseForFocusLoss = sp.getBoolean(PREF_PAUSE_PLAYBACK_FOR_FOCUS_LOSS, false);
|
||||
}
|
||||
} else if (key.equals(PREF_PAUSE_ON_HEADSET_DISCONNECT)) {
|
||||
pauseOnHeadsetDisconnect = sp.getBoolean(PREF_PAUSE_ON_HEADSET_DISCONNECT, true);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setPlaybackSpeed(String speed) {
|
||||
|
|
|
@ -899,7 +899,7 @@ public class PlaybackService extends Service {
|
|||
intent.getAction().equals(ACTION_SKIP_CURRENT_EPISODE)) {
|
||||
if (AppConfig.DEBUG)
|
||||
Log.d(TAG, "Received SKIP_CURRENT_EPISODE intent");
|
||||
endPlayback(true);
|
||||
mediaPlayer.endPlayback();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -737,6 +737,26 @@ public class PlaybackServiceMediaPlayer {
|
|||
}
|
||||
};
|
||||
|
||||
public void endPlayback() {
|
||||
executor.submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
playerLock.lock();
|
||||
|
||||
if (playerStatus != PlayerStatus.INDETERMINATE) {
|
||||
setPlayerStatus(PlayerStatus.INDETERMINATE, media);
|
||||
}
|
||||
if (mediaPlayer != null) {
|
||||
mediaPlayer.reset();
|
||||
|
||||
}
|
||||
callback.endPlayback(true);
|
||||
|
||||
playerLock.unlock();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds information about a PSMP object.
|
||||
*/
|
||||
|
@ -808,14 +828,7 @@ public class PlaybackServiceMediaPlayer {
|
|||
};
|
||||
|
||||
private void genericOnCompletion() {
|
||||
executor.submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
audioManager.abandonAudioFocus(audioFocusChangeListener);
|
||||
callback.endPlayback(true);
|
||||
}
|
||||
});
|
||||
|
||||
endPlayback();
|
||||
}
|
||||
|
||||
private final com.aocate.media.MediaPlayer.OnBufferingUpdateListener audioBufferingUpdateListener = new com.aocate.media.MediaPlayer.OnBufferingUpdateListener() {
|
||||
|
|
Loading…
Reference in New Issue