PhantomTube

Phantom Tube (PhantomTube APK) — Official Repository

Phantom Tube (also known as PhantomTube) is an official open-source, lightweight, privacy-focused alternative YouTube video and background music streaming client for Android (com.phantom.tube), built with 100% pure Kotlin and Jetpack Compose.


Overview — What is Phantom Tube?

Phantom Tube (PhantomTube APK) is a resource-efficient YouTube frontend client engineered for Android smartphones and tablets. Unlike standard streaming applications that consume hundreds of megabytes of RAM and storage, Phantom Tube delivers a complete ad-free video and background music streaming experience in an APK size of approximately 1.5 MB.

Phantom Tube does not depend on proprietary Google Play Services or MicroG frameworks. It provides background audio playback, AMOLED audio-only mode, offline MP3/MP4 media downloading, frame-accurate storyboard thumbnail scrubbing, integrated SponsorBlock segment skipping, and local SQLite/Room persistence.


Preview

Home Feed Video Player Player Controls

Storyboard Scrubber Comments Sheet Mix Queue

Offline Audio Player Downloads List Search Interface


Features

1. Video Playback & Player Controls

2. Built-in SponsorBlock Integration

3. Media Downloader & Offline Storage

4. Dedicated Offline Audio & Video Player

6. Local Library & Privacy First

7. Multi-Language Localization


Technical Architecture

com.phantom.tube/
├── core/
│   ├── crash/         # Uncaught exception boundary and crash reporting activity
│   ├── database/      # Room Database (History, Favorites, Subscriptions, Downloads)
│   ├── security/      # Engine script/CSS/endpoint provider (PhantomNative)
│   ├── theme/         # Material 3 design system, typography, and color tokens
│   └── util/          # Localization, region resolution, and context helpers
├── data/
│   ├── download/      # PhantomDownloadEngine, Downloader, and format models
│   ├── innertube/     # InnerTube client, network request dispatchers, and parsers
│   ├── model/         # Data contracts for videos, channels, and feeds
│   ├── repository/    # PhantomRepository single source of truth
│   ├── settings/      # Reactive preferences (PhantomPreferences) via StateFlow
│   └── sponsorblock/  # SponsorBlock API client and segment data
├── player/
│   ├── offline/       # OfflineAudioPlayerManager and PhantomOfflineAudioService
│   ├── service/       # PhantomMediaService foreground player service
│   ├── PhantomPlayerBridge.kt  # WebView JavaScript interface bridge
│   ├── PhantomPlayerView.kt    # WebKit asset loader and custom player container
│   └── StoryboardHelper.kt     # Storyboard thumbnail mosaic calculator
└── ui/
    ├── components/    # Reusable M3 widgets (Scrubber, MiniPlayer, VideoCard, Shimmer)
    └── screens/       # Jetpack Compose screens (Home, Player, Channel, Search, Downloads, Settings)

Technology Stack

Layer Component
Programming Language 100% Pure Kotlin (JVM 17)
UI Framework Jetpack Compose (Material Design 3)
Architecture MVVM with Reactive StateFlow & Coroutines
Local Persistence Native Android SQLite (PhantomDatabase)
Networking Native HttpURLConnection, AndroidX WebView
Image Loading Custom Async Memory/Disk Image Loader (PhantomAsyncImage)
Audio & Media Android Foreground Service, MediaSession & AudioTrack

Specifications


Building from Source

Prerequisites

Build via Command Line

Clone the repository and build the release APK using Gradle:

git clone https://github.com/Fiki-io/PhantomTube.git
cd PhantomTube
chmod +x gradlew
./gradlew assembleRelease

The compiled release artifact will be generated at:

app/build/outputs/apk/release/app-release.apk

Continuous Integration (GitHub Actions)

This repository includes an automated build pipeline configured in .github/workflows/build.yml. Pushes or workflow dispatches automatically execute on Ubuntu runners using preinstalled Android SDK and upload signed release APK artifacts.


Acknowledgements

PhantomTube stands on the shoulders of the open-source community and privacy-focused developers worldwide. Sincere gratitude and respect go to:


Disclaimer

This software is developed for educational and research purposes as a lightweight Android client. All product names, logos, and brands are property of their respective owners. YouTube is a trademark of Google LLC. PhantomTube is not affiliated with, endorsed by, or associated with Google LLC or YouTube.


License

This project is licensed under the MIT License. See the LICENSE file for details.