mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2025-10-03 09:49:21 +02:00
Player/handleIntent: call handleIntentPost unconditionally
We always need to handleIntentPost otherwise the VideoDetailFragment is not setup correctly.
This commit is contained in:
parent
d77771a60c
commit
eb277fe14b
2 changed files with 3 additions and 5 deletions
|
@ -375,7 +375,6 @@ public final class Player implements PlaybackListener, Listener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final PlayerType oldPlayerType = playerType;
|
|
||||||
playerType = newPlayerType;
|
playerType = newPlayerType;
|
||||||
initUIsForCurrentPlayerType();
|
initUIsForCurrentPlayerType();
|
||||||
isAudioOnly = audioPlayerSelected();
|
isAudioOnly = audioPlayerSelected();
|
||||||
|
@ -459,8 +458,6 @@ public final class Player implements PlaybackListener, Listener {
|
||||||
initPlayback(newPlayQueue, playWhenReady);
|
initPlayback(newPlayQueue, playWhenReady);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleIntentPost(oldPlayerType);
|
|
||||||
|
|
||||||
}, throwable -> {
|
}, throwable -> {
|
||||||
// This will only show a snackbar if the passed context has a root view:
|
// 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
|
// 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);
|
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 (oldPlayerType != playerType && playQueue != null) {
|
||||||
// If playerType changes from one to another we should reload the player
|
// If playerType changes from one to another we should reload the player
|
||||||
// (to disable/enable video stream or to set quality)
|
// (to disable/enable video stream or to set quality)
|
||||||
|
|
|
@ -169,7 +169,9 @@ public final class PlayerService extends MediaBrowserServiceCompat {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
|
final PlayerType oldPlayerType = player.getPlayerType();
|
||||||
player.handleIntent(intent);
|
player.handleIntent(intent);
|
||||||
|
player.handleIntentPost(oldPlayerType);
|
||||||
player.UIs().get(MediaSessionPlayerUi.class)
|
player.UIs().get(MediaSessionPlayerUi.class)
|
||||||
.ifPresent(ui -> ui.handleMediaButtonIntent(intent));
|
.ifPresent(ui -> ui.handleMediaButtonIntent(intent));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue