Skip to content

Commit 216867c

Browse files
committed
Address review comments
1 parent 1d8ea01 commit 216867c

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,20 +2219,20 @@ public void useVideoAndSubtitles(final boolean videoAndSubtitlesEnabled) {
22192219
final SourceType sourceType = videoResolver.getStreamSourceType()
22202220
.orElse(SourceType.VIDEO_WITH_AUDIO_OR_AUDIO_ONLY);
22212221

2222-
setRecovery();
2222+
setRecovery(); // making sure to save playback position before reloadPlayQueueManager()
22232223

22242224
if (playQueueManagerReloadingNeeded(sourceType, info, getVideoRendererIndex())) {
22252225
reloadPlayQueueManager();
22262226
}
22272227
}, () -> {
22282228
/*
22292229
The current metadata may be null sometimes (for e.g. when using an unstable connection
2230-
in livestreams) so we will be not able to execute the block below
2230+
in livestreams) so we will be not able to execute the block above
22312231
22322232
Reload the play queue manager in this case, which is the behavior when we don't know the
22332233
index of the video renderer or playQueueManagerReloadingNeeded returns true
22342234
*/
2235-
setRecovery();
2235+
setRecovery(); // making sure to save playback position before reloadPlayQueueManager()
22362236
reloadPlayQueueManager();
22372237
});
22382238

app/src/main/java/org/schabi/newpipe/player/resolver/PlaybackResolver.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ static MediaSource maybeBuildLiveMediaSource(final PlayerDataSource dataSource,
201201

202202
try {
203203
final StreamInfoTag tag = StreamInfoTag.of(info);
204+
// Prefer DASH over HLS because of an exoPlayer bug that causes the background player to
205+
// also fetch the video stream even if it is supposed to just fetch the audio stream.
204206
if (!info.getDashMpdUrl().isEmpty()) {
205207
return buildLiveMediaSource(
206208
dataSource, info.getDashMpdUrl(), C.CONTENT_TYPE_DASH, tag);

app/src/main/java/org/schabi/newpipe/player/ui/BackgroundPlayerUi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import org.schabi.newpipe.player.Player;
66

77
/**
8-
* This is not a real UI for the background player, it used to disable fetching video and text
9-
* tracks with it.
8+
* This is not a "graphical" UI for the background player, but it is used to disable fetching video
9+
* and text tracks with it.
1010
*
1111
* <p>
1212
* This allows reducing data usage for manifest sources with demuxed audio and video,

0 commit comments

Comments
 (0)