Address review comments
This commit is contained in:
parent
b25240eea9
commit
3a7abecdcb
3 changed files with 7 additions and 5 deletions
|
|
@ -2219,7 +2219,7 @@ public final class Player implements PlaybackListener, Listener {
|
||||||
final SourceType sourceType = videoResolver.getStreamSourceType()
|
final SourceType sourceType = videoResolver.getStreamSourceType()
|
||||||
.orElse(SourceType.VIDEO_WITH_AUDIO_OR_AUDIO_ONLY);
|
.orElse(SourceType.VIDEO_WITH_AUDIO_OR_AUDIO_ONLY);
|
||||||
|
|
||||||
setRecovery();
|
setRecovery(); // making sure to save playback position before reloadPlayQueueManager()
|
||||||
|
|
||||||
if (playQueueManagerReloadingNeeded(sourceType, info, getVideoRendererIndex())) {
|
if (playQueueManagerReloadingNeeded(sourceType, info, getVideoRendererIndex())) {
|
||||||
reloadPlayQueueManager();
|
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
|
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
|
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
|
index of the video renderer or playQueueManagerReloadingNeeded returns true
|
||||||
*/
|
*/
|
||||||
setRecovery();
|
setRecovery(); // making sure to save playback position before reloadPlayQueueManager()
|
||||||
reloadPlayQueueManager();
|
reloadPlayQueueManager();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -201,6 +201,8 @@ public interface PlaybackResolver extends Resolver<StreamInfo, MediaSource> {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final StreamInfoTag tag = StreamInfoTag.of(info);
|
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()) {
|
if (!info.getDashMpdUrl().isEmpty()) {
|
||||||
return buildLiveMediaSource(
|
return buildLiveMediaSource(
|
||||||
dataSource, info.getDashMpdUrl(), C.CONTENT_TYPE_DASH, tag);
|
dataSource, info.getDashMpdUrl(), C.CONTENT_TYPE_DASH, tag);
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ import androidx.annotation.NonNull;
|
||||||
import org.schabi.newpipe.player.Player;
|
import org.schabi.newpipe.player.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is not a real UI for the background player, it used to disable fetching video and text
|
* This is not a "graphical" UI for the background player, but it is used to disable fetching video
|
||||||
* tracks with it.
|
* and text tracks with it.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* This allows reducing data usage for manifest sources with demuxed audio and video,
|
* This allows reducing data usage for manifest sources with demuxed audio and video,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue