$ show FongMi/TV
This repository is an Android TV application (役čŚTV) that provides a comprehensive media center experience for streaming Video-on-Demand (VOD) and live television. It features a plugin-based content aggregation system using spiders written in Java, Python (via Chaquopy), and JavaScript (via QuickJS), allowing users to browse and play content from multiple external sources. The application supports multiple player engines (ExoPlayer and mpv), hardware/software decoding, subtitle and danmaku (bullet comment) overlays, DLNA casting (both sender and renderer), and a local HTTP server for remote control and file sharing. Architecturally, the project is a multi-module Gradle build with a shared core library (catvod) providing network utilities, cryptography, and data models. The main app module contains two UI tracks: 'leanback' for TV remote control navigation and 'mobile' for touch-based phone interaction, both sharing common logic under app/src/main. The system uses an event-driven architecture with EventBus, a Room-based SQLite database for persistence, and a ViewModel pattern for reactive UI updates. External content sources are integrated through a standardized Spider interface, with loaders for JAR, Python, and JavaScript plugins. Key features include a sophisticated playback controller with fallback policies, preloading, and history management; extensive audio/video effect pipelines (equalizer, loudness normalization, color adjustment); danmaku search and display; EPG (Electronic Program Guide) with timezone-aware parsing; and a comprehensive settings system covering player, decoding, subtitles, and network configuration. The project also includes a documentation website built with Next.js, providing developer guides for the spider API and local HTTP API.
The LLM identified 6 files worth highlighting for reuse:
Defines a generic interface for diff-based updates in RecyclerView adapters. Methods areItemsTheSame and areContentsTheSame allow efficient partial updates of list items, reducing UI flicker and improving performance. This pattern is reusable in any Android app with dynamic lists.
Abstract base class for configuration loading (VOD, Live, Wallpaper). Manages async initialization with task cancellation, error handling, and event posting via EventBus. Provides a reusable pattern for loading remote or local configurations with caching and callback support.
Unified interface for video and audio effects across different player engines (ExoPlayer, mpv). Defines methods for applying equalizer, loudness normalization, color adjustment, and detail enhancement. Enables engine-agnostic effect management and is reusable in any media player application.
Custom HTTP client built on OkHttp3 with a chain of interceptors for authentication, proxy, DNS-over-HTTPS, and response modification. Provides a centralized, configurable networking layer that can be extracted and reused in any Java application requiring advanced HTTP capabilities.
Self-contained JavaScript cryptographic library implementing MD5, SHA family, AES, DES, RC4, HMAC, PBKDF2, and various encodings. Designed for cross-platform use (browser, Node.js, QuickJS) with no external dependencies. Reusable in any JavaScript project requiring cryptographic operations.
Massive bundled JavaScript library containing a full HTML5 parser, Cheerio-like DOM manipulation API, CSS selector engine, and Nunjucks/Jinja2-style template engine. Also includes dayjs, JSONPath, URI parser, and lodash utilities. Designed for embedding in QuickJS environments for server-side HTML processing and template rendering.