Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CouchTube Remote

CouchTube Remote

A native Android remote for CouchTube, the controller-first YouTube client for Windows HTPCs. Your phone becomes a D-pad remote, a keyboard for search, and a playback controller with a live now-playing readout - and its best trick: share any YouTube link to it and the video plays on your HTPC.

Pairing is local only (scan a QR code or type a PIN over your LAN) - no accounts, no cloud, nothing leaves your network.

Built with Jetpack Compose (Material 3) and a single OkHttp WebSocket to the CouchTube companion server.

Why

CouchTube exists because Windows never had a good way to enjoy YouTube from the couch. As an HTPC user myself, I wanted to browse and watch on the big screen with just a controller - no browser, no keyboard, no mouse. So I built one.

A controller is great for browsing but awkward for typing a search or grabbing a link you found on your phone, so I wrote this companion app to fill that gap. Point it at your HTPC once, and from then on you can navigate menus, dictate a search, scrub and pause, switch accounts, and push links straight to the screen without ever touching the PC.

Like my other projects, CouchTube is free. I'm releasing it on my son Mihajlo's second birthday, so in a way it's a present for everyone.

Features

  • D-pad remote - a directional pad with OK, Back, and Menu, plus corner shortcuts for Search and the settings/player controls, laid out for one-handed thumb use.
  • Search with voice - type or dictate a query (uses the phone's own speech recognizer) with a remembered voice-language picker, then send it to CouchTube.
  • Now playing - a fixed card with a scrolling title, thumbnail, and transport buttons (play/pause, stop, skip, seek +/-10s, next).
  • Player controls sheet - volume (OS-level step and mute), playback speed, like/dislike, subscribe, comments, live chat, watch later, save, a SponsorBlock on/off shield, and caption / quality / audio-track pickers when available.
  • Window controls - bring CouchTube to the front and fullscreen (even from the Windows tray), or hide the whole window back to the tray, from your phone.
  • Multiple accounts - a profile picker with avatars mirrors CouchTube's "Who's watching", including the Guest profile.
  • Share a link to the TV - share (or open) a YouTube link from any app and choose Play now or Add to queue; the HTPC wakes, goes fullscreen, and plays.
  • Hardware volume keys - your phone's volume rocker drives the TV volume, even while the controls sheet is open.
  • Auto-discovery - finds CouchTube on the LAN over mDNS/NSD, so you rarely type an address by hand.

How pairing works

CouchTube runs a small WebSocket server on your local network and advertises itself over mDNS (_couchtube._tcp). The remote:

  1. Discovers the HTPC on the LAN (or you scan its pairing QR / enter the PIN).
  2. Exchanges a PIN once to pair and receives a session token.
  3. Reconnects automatically on later launches using that token.

The token and TV list are stored in EncryptedSharedPreferences on the phone and excluded from backup. The protocol is protocol version 1: a plain-text JSON message stream (nav / text / transport / act / open / profile frames out; state / position / queue / profiles messages in).

Note: the LAN link is plain ws:// (no TLS by design), so the pairing token crosses your local network in plaintext. This is a home-LAN tool; don't run it over untrusted networks.

Requirements

  • Android 10 (API 29) or newer.
  • Google Play services on the phone (the QR scanner uses the unbundled ML Kit barcode model, downloaded on first use).
  • A PC running CouchTube on the same local network.

Build and run

Open the project in a recent Android Studio (Giraffe or newer) and run the app configuration on a device or emulator. Or from the command line:

./gradlew installDebug

The Gradle wrapper JAR is not committed (it is a binary). If ./gradlew is missing, run gradle wrapper once, or let Android Studio regenerate it, first. local.properties (your SDK path) is created automatically by Android Studio.

Toolchain: AGP 9.2.1, Kotlin 2.2.10, JVM target 17, compileSdk / targetSdk 35, minSdk 29.

Project layout

app/src/main/java/com/couchtuberemote/app/
  protocol/   Models, ProtocolCodec (parse/build JSON frames), command constants
  data/       PairedTv model + encrypted TvStore
  net/        RemoteConnection (the OkHttp socket + state machine),
              RemoteController (process-wide command facade)
  discovery/  TvDiscovery (NsdManager mDNS browse/resolve)
  vm/         RemoteViewModel (discovery lifecycle + connection flows)
  ui/         Compose screens: connect / pair (QR scanner) / remote,
              theme, and the remote's d-pad, now-playing, and controls
  MainActivity (launcher + pair deep link + volume-key capture)
  ShareActivity (receives shared / opened YouTube links)

Key libraries: Jetpack Compose (Material 3), Navigation Compose, OkHttp (WebSocket), org.json (framing), CameraX + ML Kit (QR scanning), Coil (thumbnails and avatars), AndroidX Security Crypto (encrypted storage).

Disclaimer

CouchTube Remote is a companion for CouchTube, which talks to YouTube's private InnerTube API. It is unofficial and not affiliated with, endorsed by, or sponsored by YouTube or Google. All YouTube names, logos, and trademarks belong to Google.

License

Free software licensed under the GNU General Public License v3.0 or later. See the LICENSE file for the full text.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages