Address review comments

This commit is contained in:
Stypox 2026-01-28 02:20:33 +01:00
parent 1d8ea0181f
commit 216867c597
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
3 changed files with 7 additions and 5 deletions

View File

@ -2219,7 +2219,7 @@ public final class Player implements PlaybackListener, Listener {
final SourceType sourceType = videoResolver.getStreamSourceType()
.orElse(SourceType.VIDEO_WITH_AUDIO_OR_AUDIO_ONLY);
setRecovery();
setRecovery(); // making sure to save playback position before reloadPlayQueueManager()
if (playQueueManagerReloadingNeeded(sourceType, info, getVideoRendererIndex())) {
reloadPlayQueueManager();
@ -2227,12 +2227,12 @@ public final class Player implements PlaybackListener, Listener {
}, () -> {
/*
The current metadata may be null sometimes (for e.g. when using an unstable connection
in livestreams) so we will be not able to execute the block below
in livestreams) so we will be not able to execute the block above
Reload the play queue manager in this case, which is the behavior when we don't know the
index of the video renderer or playQueueManagerReloadingNeeded returns true
*/
setRecovery();
setRecovery(); // making sure to save playback position before reloadPlayQueueManager()
reloadPlayQueueManager();
});

View File

@ -201,6 +201,8 @@ public interface PlaybackResolver extends Resolver<StreamInfo, MediaSource> {
try {
final StreamInfoTag tag = StreamInfoTag.of(info);
// Prefer DASH over HLS because of an exoPlayer bug that causes the background player to
// also fetch the video stream even if it is supposed to just fetch the audio stream.
if (!info.getDashMpdUrl().isEmpty()) {
return buildLiveMediaSource(
dataSource, info.getDashMpdUrl(), C.CONTENT_TYPE_DASH, tag);

View File

@ -5,8 +5,8 @@ import androidx.annotation.NonNull;
import org.schabi.newpipe.player.Player;
/**
* This is not a real UI for the background player, it used to disable fetching video and text
* tracks with it.
* This is not a "graphical" UI for the background player, but it is used to disable fetching video
* and text tracks with it.
*
* <p>
* This allows reducing data usage for manifest sources with demuxed audio and video,