Replace Telegram's Chromecast route with local DLNA / UPnP casting on Android.
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.
- 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
MediaSessionnotification 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.
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.
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)
- 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.
- Download and install the latest TeleCast APK.
- Enable TeleCast in LSPosed and select the target Telegram package.
- Force stop and restart Telegram.
- Open a video in Telegram's full-screen player.
- Tap the original cast button, now labeled TeleCast, and select a discovered receiver.
- On Android 13 or later, allow notifications to keep system media controls available outside Telegram.
- 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
- JDK 17 or JDK 21
- Android SDK Platform 35 and Build-Tools 35.0.0 or later
./gradlew assembleDebugThe debug APK is written to app/build/outputs/apk/debug/app-debug.apk.
TeleCast is released under the MIT License.