Skip to content

Commit 83f611b

Browse files
committed
Player/handleIntent: call handleIntentPost unconditionally
We always need to handleIntentPost otherwise the VideoDetailFragment is not setup correctly.
1 parent ab6e25d commit 83f611b

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/Player.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ public void handleIntent(@NonNull final Intent intent) {
375375
}
376376
}
377377

378-
final PlayerType oldPlayerType = playerType;
379378
playerType = newPlayerType;
380379
initUIsForCurrentPlayerType();
381380
// TODO: what does the following comment mean? Is that a relict?
@@ -461,8 +460,6 @@ public void handleIntent(@NonNull final Intent intent) {
461460
initPlayback(newPlayQueue, playWhenReady);
462461
}
463462

464-
handleIntentPost(oldPlayerType);
465-
466463
}, throwable -> {
467464
final var errorInfo = new ErrorInfo(throwable, UserAction.PLAY_ON_POPUP,
468465
dat.getUrl());
@@ -564,11 +561,10 @@ public void handleIntent(@NonNull final Intent intent) {
564561
initPlayback(samePlayQueue ? playQueue : newQueue, playWhenReady);
565562
}
566563

567-
handleIntentPost(oldPlayerType);
568564
}
569565

570566

571-
private void handleIntentPost(final PlayerType oldPlayerType) {
567+
public void handleIntentPost(final PlayerType oldPlayerType) {
572568
if (oldPlayerType != playerType && playQueue != null) {
573569
// If playerType changes from one to another we should reload the player
574570
// (to disable/enable video stream or to set quality)

app/src/main/java/org/schabi/newpipe/player/PlayerService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ public int onStartCommand(final Intent intent, final int flags, final int startI
169169
}
170170

171171
if (player != null) {
172+
final PlayerType oldPlayerType = player.getPlayerType();
172173
player.handleIntent(intent);
174+
player.handleIntentPost(oldPlayerType);
173175
player.UIs().get(MediaSessionPlayerUi.class)
174176
.ifPresent(ui -> ui.handleMediaButtonIntent(intent));
175177
}

0 commit comments

Comments
 (0)