Skip to content

Disable video and text tracks in background player and prefer DASH manifests over HLS ones for livestreams#12601

Merged
Stypox merged 7 commits intoTeamNewPipe:devfrom
AudricV:live-prefer-dash-and-fetch-bg-audio-only
Jan 28, 2026
Merged

Disable video and text tracks in background player and prefer DASH manifests over HLS ones for livestreams#12601
Stypox merged 7 commits intoTeamNewPipe:devfrom
AudricV:live-prefer-dash-and-fetch-bg-audio-only

Conversation

@AudricV
Copy link
Copy Markdown
Member

@AudricV AudricV commented Sep 4, 2025

What is it?

  • Bugfix (user facing)

Description of the changes in your PR

This PR prioritizes DASH manifests over HLS ones for live sources, and works around bugged YouTube DASH manifests in order to use them. This workaround has been only tested for running livestreams and not running premieres (i.e. in the time the video can be played as a livestream during its release), so please test if you can get a running premiere. YouTube DASH manifests allow to rewind up to 4 hours to the current live time.

It also disables fetching video and text tracks in background player, in order to reduce data usage for livestreams on services on which we can get DASH manifests. When there are only HLS ones, nothing will change, at least for video track fetching, due to an ExoPlayer bug which still fetches video (and subtitles?), even if it has been disabled with the track selector (a low priority has been given by the ExoPlayer team to this bug for several years without any change).

Fixes the following issue(s)

Fixes #12024 and fixes #11756 (for non-HLS sources).
Related issue: #10158

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

@AudricV AudricV added bug Issue is related to a bug multiservice Issues related to multiple services player Issues related to any player (main, popup and background) labels Sep 4, 2025
@github-actions github-actions Bot added the size/medium PRs with less than 250 changed lines label Sep 4, 2025
@AudricV AudricV added the ready for review Most of the work is done, PR is now ready for a review label Sep 24, 2025
@Stypox Stypox added this to v0.28.x Sep 25, 2025
@github-project-automation github-project-automation Bot moved this to Todo in v0.28.x Sep 25, 2025
@Stypox Stypox moved this from Todo to In Progress in v0.28.x Sep 25, 2025
Copy link
Copy Markdown
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you! I just have a couple of small questions/nitpicks, but then this can be merged

Comment thread app/src/main/java/org/schabi/newpipe/player/ui/BackgroundPlayerUi.java Outdated
Comment thread app/src/main/java/org/schabi/newpipe/player/Player.java Outdated
Comment thread app/src/main/java/org/schabi/newpipe/player/Player.java Outdated
@AudricV AudricV removed the ready for review Most of the work is done, PR is now ready for a review label Jan 27, 2026
AudricV and others added 6 commits January 28, 2026 02:13
This is a hacky solution, a better one should be investigated and used.
As both subtitles and video tracks are disabled in this method, the
goal of this rename is to highlight disabling/enabled subtitles.
This allows disabling these track types when stream info has been not
loaded while the ExoPlayer instance is.

It is now possible to do so with the background player, in order to
disable fetching video and text tracks for manifest sources,
especially used for livestreams.

Also set the recovery first before reloading play queue manager in the
useVideoAndSubtitles method of the Player class.
This reduces data usage for manifest sources with demuxed audio and
video, such as livestreams, for non-HLS sources only due to an
ExoPlayer bug.
@Stypox Stypox force-pushed the live-prefer-dash-and-fetch-bg-audio-only branch from 268ae39 to 216867c Compare January 28, 2026 01:25
Copy link
Copy Markdown
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I addressed my review comments by adding a few comments to the code. I tested and this seems to work fine.

One subtle thing I noticed: when playing something in the background, and enqueueing something else, the player pauses for a fraction of a second, and then resumes. I pushed another commit to fix this: basically the code was reinitializing the background player class from scratch every time the player received an intent ;-)

@Stypox Stypox merged commit 864725b into TeamNewPipe:dev Jan 28, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in v0.28.x Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue is related to a bug multiservice Issues related to multiple services player Issues related to any player (main, popup and background) size/medium PRs with less than 250 changed lines

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[YouTube] No rewind possibility for live videos Audio only does not save data in live streams

2 participants