mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-10-23 11:27:39 +00:00
Player/handleIntent: call handleIntentPost unconditionally
We always need to handleIntentPost otherwise the VideoDetailFragment is not setup correctly.
This commit is contained in:
@@ -375,7 +375,6 @@ public final class Player implements PlaybackListener, Listener {
|
||||
}
|
||||
}
|
||||
|
||||
final PlayerType oldPlayerType = playerType;
|
||||
playerType = newPlayerType;
|
||||
initUIsForCurrentPlayerType();
|
||||
isAudioOnly = audioPlayerSelected();
|
||||
@@ -459,8 +458,6 @@ public final class Player implements PlaybackListener, Listener {
|
||||
initPlayback(newPlayQueue, playWhenReady);
|
||||
}
|
||||
|
||||
handleIntentPost(oldPlayerType);
|
||||
|
||||
}, throwable -> {
|
||||
// This will only show a snackbar if the passed context has a root view:
|
||||
// otherwise it will resort to showing a notification, so we are safe
|
||||
@@ -560,11 +557,10 @@ public final class Player implements PlaybackListener, Listener {
|
||||
initPlayback(samePlayQueue ? playQueue : newQueue, playWhenReady);
|
||||
}
|
||||
|
||||
handleIntentPost(oldPlayerType);
|
||||
}
|
||||
|
||||
|
||||
private void handleIntentPost(final PlayerType oldPlayerType) {
|
||||
public void handleIntentPost(final PlayerType oldPlayerType) {
|
||||
if (oldPlayerType != playerType && playQueue != null) {
|
||||
// If playerType changes from one to another we should reload the player
|
||||
// (to disable/enable video stream or to set quality)
|
||||
|
@@ -169,7 +169,9 @@ public final class PlayerService extends MediaBrowserServiceCompat {
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
final PlayerType oldPlayerType = player.getPlayerType();
|
||||
player.handleIntent(intent);
|
||||
player.handleIntentPost(oldPlayerType);
|
||||
player.UIs().get(MediaSessionPlayerUi.class)
|
||||
.ifPresent(ui -> ui.handleMediaButtonIntent(intent));
|
||||
}
|
||||
|
Reference in New Issue
Block a user