Skip to content

Repository files navigation

TeleCast logo

TeleCast

Replace Telegram's Chromecast route with local DLNA / UPnP casting on Android.

English · 简体中文

TeleCast is an LSPosed API 102 module that hooks Telegram's native Chromecast entry, renames it to TeleCast, and routes the current video to a DLNA / UPnP MediaRenderer on the local network. It is designed for TVs, boxes, projectors, and other receivers that support DLNA but not Google Cast.

Features

  • Native Chromecast replacement: Reuses Telegram's existing cast button and blocks the original Google Cast handoff.
  • Progressive Telegram streaming: Starts casting once enough cache is available and requests missing ranges through Telegram while playback continues.
  • Local-only media path: An embedded HTTP/1.1 server serves the receiver over Wi-Fi; no bot token, VPS, or cloud relay is required.
  • Seeking and range requests: Supports 206 Partial Content, byte ranges, progress seeking, and ±15-second controls.
  • Fast receiver discovery: Combines SSDP multicast/broadcast discovery with local-network probing for DLNA MediaRenderer devices.
  • Synchronized controls: Tracks play, pause, position, duration, and renderer disconnects between the TV and Telegram controller.
  • Telegram playback takeover: Pauses the source player after casting starts instead of leaving local playback running in parallel.
  • System media controls: Publishes a foreground MediaSession notification with media metadata, play/pause, progress, and a route back to the active Telegram controller. Available buttons may vary by Android skin.
  • Adaptive in-app controller: Provides a gesture-driven bottom controller and compact mini controller without blocking normal Telegram navigation.

How It Works

Telegram video/cache
        ↓
TeleCast local HTTP range server on the phone
        ↓  local Wi-Fi
DLNA / UPnP MediaRenderer

The TV does not connect directly to Telegram. It requests media from the phone's local TeleCast server. TeleCast serves cached bytes immediately and bridges uncached ranges through Telegram's own file loader.

Compatibility

The current implementation is device-tested against Telegram Official (org.telegram.messenger). The LSPosed scope also declares the following compatibility targets; hook compatibility can vary when a fork changes Telegram's player internals:

  • Telegram Direct / Web (org.telegram.messenger.web)
  • Telegram Beta (org.telegram.messenger.beta)
  • NekoX (nekox.messenger)
  • Telegram X (org.thunderdog.challegram)
  • Plus Messenger (org.telegram.plus, org.telegram.messenger.plus)
  • BifToGram (org.telegram.BifToGram)
  • iMe Messenger (com.iMe.android)
  • Nicegram (app.nicegram)
  • Exteragram (com.exteragram.messenger)
  • Other declared Telegram variant (com.telegram.messenger)

Installation

Requirements

  • Android 8.0 or later.
  • A rooted device using Magisk, KernelSU, or APatch.
  • LSPosed with modern module API support.
  • The phone and receiver connected to the same local network.

Steps

  1. Download and install the latest TeleCast APK.
  2. Enable TeleCast in LSPosed and select the target Telegram package.
  3. Force stop and restart Telegram.
  4. Open a video in Telegram's full-screen player.
  5. Tap the original cast button, now labeled TeleCast, and select a discovered receiver.
  6. On Android 13 or later, allow notifications to keep system media controls available outside Telegram.

Playback Controls

  • Play and pause
  • Seek using the progress bar
  • Rewind or fast-forward by 15 seconds
  • Playback-speed requests when supported by the renderer
  • Disconnect from the receiver
  • Tap the system media notification to return to the active Telegram video controller

Building from Source

Requirements

  • JDK 17 or JDK 21
  • Android SDK Platform 35 and Build-Tools 35.0.0 or later
./gradlew assembleDebug

The debug APK is written to app/build/outputs/apk/debug/app-debug.apk.

License

TeleCast is released under the MIT License.

About

LSPosed module that adds DLNA/UPnP casting to Telegram for Android.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages