Skip to content

fix: skip Cronet on Android TV to fix ExoPlayer error 2004/2001 - #3254

Open
fgmitesh wants to merge 3 commits into
recloudstream:masterfrom
fgmitesh:fix/tv-cronet-ipv6-error-2004
Open

fgmitesh wants to merge 3 commits into
recloudstream:masterfrom
fgmitesh:fix/tv-cronet-ipv6-error-2004

Conversation

@fgmitesh

Copy link
Copy Markdown
Contributor

Android TV gets ExoPlayer errors 2004/2001 on sources that work fine
on mobile over the same Wi-Fi.

Root cause: CloudStream uses Cronet for video playback whenever it's
available, but Cronet manages its own native networking stack — its
own DNS resolution, IPv6 handling, and QUIC/UDP transport — completely
independent of OkHttp. Many Android TV boxes have broken IPv6 and/or
block UDP, and Cronet has no public API to work around either.

Fix:

  • IPv4OnlyDns (DohProviders.kt): strips IPv6 from DNS results
  • RequestsHelper.kt: wires IPv4OnlyDns into the default DNS path too,
    plus explicit 30s OkHttp timeouts (10s default was too short for TV)
  • CS3IPlayer.kt: skips Cronet entirely on TV (isLayout(TV)), falling
    back to the already-fixed OkHttp path. Also disables QUIC and bumps
    Cronet's own timeout to 30s as defense-in-depth.

Increased OkHttp timeouts to 30 seconds to accommodate slower TV network stacks, addressing ExoPlayer error 2004/2001.
Increased CRONET timeout for TV devices due to slower network stacks and added comments explaining the changes.
@fire-light42

Copy link
Copy Markdown
Collaborator

Did you test this pull request?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants