diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java index b0858f2e3..b70441d51 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -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(); }); diff --git a/app/src/main/java/org/schabi/newpipe/player/resolver/PlaybackResolver.java b/app/src/main/java/org/schabi/newpipe/player/resolver/PlaybackResolver.java index 33a007597..7dc80a958 100644 --- a/app/src/main/java/org/schabi/newpipe/player/resolver/PlaybackResolver.java +++ b/app/src/main/java/org/schabi/newpipe/player/resolver/PlaybackResolver.java @@ -201,6 +201,8 @@ public interface PlaybackResolver extends Resolver { 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); diff --git a/app/src/main/java/org/schabi/newpipe/player/ui/BackgroundPlayerUi.java b/app/src/main/java/org/schabi/newpipe/player/ui/BackgroundPlayerUi.java index 9530033d1..4172df35e 100644 --- a/app/src/main/java/org/schabi/newpipe/player/ui/BackgroundPlayerUi.java +++ b/app/src/main/java/org/schabi/newpipe/player/ui/BackgroundPlayerUi.java @@ -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. * *

* This allows reducing data usage for manifest sources with demuxed audio and video,