Fixed crash when losing audio focus
This commit is contained in:
parent
b3c3e04fd9
commit
119892f6b5
|
@ -325,6 +325,9 @@ public class PlaybackService extends Service {
|
||||||
if (player.isPlaying()) {
|
if (player.isPlaying()) {
|
||||||
Log.d(TAG, "Pausing playback.");
|
Log.d(TAG, "Pausing playback.");
|
||||||
player.pause();
|
player.pause();
|
||||||
|
if (positionSaver != null) {
|
||||||
|
positionSaver.cancel(true);
|
||||||
|
}
|
||||||
saveCurrentPosition();
|
saveCurrentPosition();
|
||||||
setStatus(PlayerStatus.PAUSED);
|
setStatus(PlayerStatus.PAUSED);
|
||||||
stopForeground(true);
|
stopForeground(true);
|
||||||
|
|
Loading…
Reference in New Issue