Repository navigation
fix(player): load auto-translated captions on Android 14 and newer - #2066
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This was referenced Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HttpEngineDataSourceonandroid.net.http.HttpEngine) on Android 14 and newer. YouTube answers an auto-translated caption (&tlang=) over it and refuses the same URL over OkHttp with 429.Accept, without the browserOrigin,RefererandSec-Fetch-*headers, like NewTube.On a phone (same network, same video, interleaved runs), OkHttp got 429 on every translated request, while
HttpEngineDataSourceloaded the Arabic translation in 3 of 3 rounds, with the captions on screen.Related issue
Part of #1369 and #1434
Change type
Validation
./gradlew :app:assembleGithubDebug./gradlew :app:testGithubDebugUnitTest --tests '*GoogleVideoRequestPolicyTest' --tests '*CaptionTrackResolverTest' --tests '*SubtitleLoadDiagnosticsTest'(22 tests, 0 failed)spotlessCheck,:app:compileFossDebugKotlin,:app:lintGithubDebug)Cronet version: 150.0.7871.41,HttpEngineDataSource) after two 429 retries,fmt=vtt source=asr bytes=221001, Arabic captions on screen.Test device and Android version: Xiaomi phone, Android 16 (API 36)
Screenshots or recordings
Risk and compatibility
No new dependency:
HttpEngineDataSourceships inmedia3-datasource1.11.0 and the engine is part of Android 14.The engine is built once, on the first caption, and kept for the process.
With the app proxy on, captions stay on OkHttp, since
HttpEnginetakes no proxy. Android 13 and older also stay on OkHttp.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.