Skip to content
aaamoederPublic

About

Cast X (Twitter) videos and live broadcasts from Chrome to your Android TV. Built for watching SpaceX launches on the big screen.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

x-cast

x-cast: watch livestreams from X on your Android TV

Living room image is AI-generated. TV image: Starship Flight 5 liftoff, photo by Steve Jurvetson, CC BY 2.0.

Purpose

Watch videos and live broadcasts from X (x.com) on your Android TV. The official X app on Android TV is gone and casting from the browser does not work, so x-cast adds a Cast button to every video on x.com in Chrome and plays it on your TV with a small companion app. Made with rocket launches in mind: SpaceX streams on X, full screen, on the big screen.

Status: alpha. Tested on an NVIDIA SHIELD TV (Android 11) with Chrome on desktop. Other Android TV / Google TV devices (Android 8.0 or newer) should work but are untested. Live broadcasts are supported but have had little real-world testing so far. Feedback and issues are welcome.

Requirements

  • Chrome (or another Chromium browser that can load unpacked extensions) on a desktop or laptop.
  • An Android TV or Google TV device with Android 8.0 or newer, on the same home network as the computer.

How it works

  1. Chrome extension (extension/): puts a standard Cast icon in the control bar of every X video, next to the full screen button. A click opens a Cast to menu with every TV on your network that runs the x-cast app.
  2. The X player plays from a temporary blob: URL. The extension therefore watches the real stream URLs the tab requests (video.twimg.com for videos, *.pscp.tv for broadcasts), links them to the right video, checks whether the stream is live, and sends the URL, title and current position to the TV.
  3. TV app (tv-app/, package io.github.aaamoeder.xcast): a background service listens on port 8790 and starts when the TV boots. On a cast it wakes the TV (also from the screensaver), brings the player (Media3 / ExoPlayer) to the front and plays the stream directly from X.
  4. Remote control on the TV: the video starts without controls. Left and right skip back and forward (5, 10, 15 or 30 seconds, set in the extension options) with a short time bar. Any other key shows the controls with the title. Back first hides the controls, a second Back closes the player.

Why not Chromecast?

video.twimg.com refuses (HTTP 403) any Referer other than x.com or twitter.com. The default Chromecast receiver runs on gstatic.com and always sends that referrer, so regular X videos fail with LOAD_FAILED. The x-cast TV app fetches the stream itself with Referer: https://x.com/.

Install

1. TV app

The TV app is not in the Play Store, so you install the APK yourself ("sideloading"). Pick one of the two ways below. Menu names can differ a little between TV brands and Android versions.

Option A: on the TV itself (no computer needed)

  1. Install a sideloading helper from the Play Store on your TV, for example Downloader (by AFTVnews) or Send Files to TV.
  2. Allow that helper to install apps: Settings > Apps > Security & restrictions > Unknown sources, then turn it on for the helper.
  3. Download x-cast-tv-<version>.apk from Releases with the helper (Downloader: enter the download link of the APK) and install it.
  4. Allow x-cast to come to the front while another app is open: Settings > Apps > Special app access > Display over other apps, then turn on x-cast. Without this permission a cast only works while the x-cast app is open on the TV. If your TV does not show this setting, use the adb command from option B for this step.

Option B: with adb from a computer

You need adb and Network debugging (or USB debugging) enabled on the TV (Settings > Device Preferences > About: press Build seven times to unlock Developer options).

adb connect <tv-ip>:5555
adb install x-cast-tv-<version>.apk
adb shell appops set io.github.aaamoeder.xcast SYSTEM_ALERT_WINDOW allow

The last command grants the Display over other apps permission.

Then, for both options

Open x-cast once on the TV. It starts the service and shows the address of the TV. After that it starts by itself on every boot, within about a minute after the TV is up.

2. Chrome extension

  1. Download x-cast-extension-<version>.zip from Releases and unzip it.
  2. Open chrome://extensions, enable Developer mode, click Load unpacked and select the unzipped folder.
  3. Open a video on x.com, click the Cast icon and pick your TV.

Finding the TV

A browser extension cannot discover devices the way Chromecast does. x-cast asks every address of the common home networks (192.168.0.x, 192.168.1.x, 192.168.2.x, 192.168.178.x, 10.0.0.x, 10.0.1.x) for the app. If your TV is on another network, open the extension options (right-click the x-cast icon > Options, or Details > Extension options in chrome://extensions) and enter the address that the TV app shows. Several TVs can be separated with a comma. The options also set the skip step for the remote.

Updating

  • TV app: install the newer APK over the old one, the same way as above. The permission stays.
  • Extension: replace the contents of the unzipped folder with the new version (keep the same folder, so your options stay) and click the reload icon of x-cast in chrome://extensions.

Troubleshooting

  • "No TV with the x-cast app found": check that the TV is on and on the same network as the computer, and that x-cast has been opened once on the TV. Right after the TV boots, wait about a minute. If it still is not found, enter the TV address in the extension options.
  • The cast only works while the x-cast app is open on the TV: the Display over other apps permission is missing (see Install, step 4 or option B).
  • No Cast icon on a video: reload the x.com tab after installing or updating the extension.

Security

The TV app accepts commands from any device on your local network, like Chromecast: anyone on the same network can make the TV play a video or stop it. Use it only on a trusted home network, not on a shared or guest network.

TV app API (port 8790)

  • GET /info: {"app":"x-cast","version":"...","device":"...","name":"..."}
  • POST /play: JSON {url, title, subtitle, hls, live, position, seekStep}
  • POST /stop: stops the player
  • GET /status: what is playing now

Build

  • Extension: plain JavaScript, no build step. Load extension/ unpacked.
  • TV app: cd tv-app && ./gradlew :app:assembleRelease (needs the Android SDK; set sdk.dir in tv-app/local.properties or ANDROID_HOME). Release signing reads XCAST_STORE_FILE, XCAST_STORE_PASSWORD, XCAST_KEY_ALIAS and XCAST_KEY_PASSWORD from ~/.gradle/gradle.properties. Without them the release APK is unsigned; assembleDebug works without any setup.

Versions

The extension and the TV app have their own version (see CHANGELOG.md) and their own tags: extension-vX.Y.Z and tv-app-vX.Y.Z.

Disclaimer

x-cast is an independent project. It is not affiliated with, endorsed by or sponsored by X Corp., SpaceX or Google. "X" is a trademark of X Corp.; "Chromecast" and "Google Cast" are trademarks of Google LLC. x-cast only plays streams that X already serves to your browser; respect X's terms of service and the rights of the content owners.

License

Copyright (C) 2026 aaamoeder

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See LICENSE.

Uses Media3 (Apache-2.0) and NanoHTTPD (BSD-3-Clause).

The header image (docs/header.jpg) is not covered by the GPL: it contains a photo by Steve Jurvetson under CC BY 2.0, shown on an AI-generated background.

About

Cast X (Twitter) videos and live broadcasts from Chrome to your Android TV. Built for watching SpaceX launches on the big screen.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages