Fix playback state not being updated (#7050)
This commit is contained in:
parent
edb440a5a9
commit
a846e417b0
|
@ -831,6 +831,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
|||
break;
|
||||
case PAUSED:
|
||||
updateNotificationAndMediaSession(newInfo.playable);
|
||||
PlaybackPreferences.setCurrentPlayerStatus(PlaybackPreferences.PLAYER_STATUS_PAUSED);
|
||||
if (!isCasting) {
|
||||
stateManager.stopForeground(!UserPreferences.isPersistNotify());
|
||||
}
|
||||
|
@ -841,6 +842,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
|||
//stopService();
|
||||
break;
|
||||
case PLAYING:
|
||||
PlaybackPreferences.setCurrentPlayerStatus(PlaybackPreferences.PLAYER_STATUS_PLAYING);
|
||||
saveCurrentPosition(true, null, Playable.INVALID_TIME);
|
||||
recreateMediaSessionIfNeeded();
|
||||
updateNotificationAndMediaSession(newInfo.playable);
|
||||
|
|
|
@ -109,6 +109,10 @@ public abstract class PlaybackPreferences {
|
|||
return prefs.getInt(PREF_CURRENT_PLAYER_STATUS, PLAYER_STATUS_OTHER);
|
||||
}
|
||||
|
||||
public static void setCurrentPlayerStatus(int playerStatus) {
|
||||
prefs.edit().putInt(PREF_CURRENT_PLAYER_STATUS, playerStatus).apply();
|
||||
}
|
||||
|
||||
public static float getCurrentlyPlayingTemporaryPlaybackSpeed() {
|
||||
return prefs.getFloat(PREF_CURRENTLY_PLAYING_TEMPORARY_PLAYBACK_SPEED, FeedPreferences.SPEED_USE_GLOBAL);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue