1
0
Fork 0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2025-10-03 01:39:38 +02:00

Player/handleIntent: call handleIntentPost unconditionally

We always need to handleIntentPost otherwise the VideoDetailFragment
is not setup correctly.
This commit is contained in:
Profpatsch 2025-09-06 15:31:14 +02:00
parent d77771a60c
commit eb277fe14b
2 changed files with 3 additions and 5 deletions

View file

@ -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)

View file

@ -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));
}