Skip to content

perf(downloads): let playback go first while downloading - #2353

Merged
9 commits merged into
mainfrom
perf/download-playback-first
Nov 24, 2026
Merged

9 commits merged into
mainfrom
perf/download-playback-first

Conversation

@A-EDev

@A-EDev A-EDev commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Every player (video, Shorts, music and its crossfade tail) registers on one Media3 PriorityTaskManager while it loads; downloads register below it.
  • A download waits between blocks while something loads, and steps aside mid-block, resuming from the byte it reached, so playback never shares the link.
  • The notification says "Waiting while something plays" while it waits; stall detection pauses meanwhile.

Related issue

None. Part of the downloads plan (YouTube 21.45.82 offline pipeline vs Flow). Stacked: merge from the top of the stack.

Change type

  • Bug fix
  • Feature
  • Refactor or maintenance
  • Build, packaging, or CI
  • Documentation

Validation

  • ./gradlew :app:assembleGithubDebug (top of the stack)
  • ./gradlew :app:testGithubDebugUnitTest (7,137 tests, 0 failures on the top of the stack; download and shared UI tests on this branch)
  • I ran any additional flavor-specific build or test tasks affected by this change. (ktlintCheck on this branch, :app:compileFossDebugKotlin on the top of the stack)
  • I manually tested the affected behavior on an Android device or emulator.

Test device and Android version: Xiaomi 2311DRK48G, Android 16 (HyperOS), Wi-Fi

Download during playback: notification showed the waiting state and the download moved on between the player's loads; a 60 s A/B with the download paused vs running gave 0 rebuffers both ways.

Screenshots or recordings

Risk and compatibility

Player change: one setPriorityTaskManager builder call per player, no other playback wiring. Downloads slow down while something plays, by design.

  • The change does not introduce secrets, private data, or unexpected telemetry.
  • New user-facing text uses Android string resources.
  • Dependency and lockfile changes are intentional and limited to this PR.
  • Room schema changes include the required version bump and migration, or this PR does not change the Room schema.
  • Breaking changes and upgrade steps are clearly documented.

@github-actions github-actions Bot added documentation Improvements or additions to documentation player Video and audio playback labels Nov 23, 2026
@A-EDev
A-EDev changed the base branch from perf/download-reuse-streams to main November 24, 2026 08:32
@A-EDev A-EDev closed this pull request by merging all changes into main in a4a9c70 Nov 24, 2026
@A-EDev
A-EDev deleted the perf/download-playback-first branch November 24, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation player Video and audio playback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant