AngelLive is a cross-platform (iOS, macOS, tvOS) live streaming viewer that aggregates content from multiple Chinese streaming platforms (Bilibili, etc.) via a dynamic plugin system. The application is built entirely in Swift, using SwiftUI for the UI layer with UIKit bridging where needed. Its core architecture revolves around a shared library, AngelLiveCore, which provides a plugin runtime for loading JavaScript-based platform adapters, a custom danmaku (bullet-chat) rendering engine, unified playback recovery with a state machine, and iCloud-based favorite and credential synchronization. The macOS and tvOS targets share the same core but have platform-specific UI components and input handling (e.g., tvOS focus-driven navigation, macOS menu bar and window management). The system is characterized by a high degree of modularity and concurrency: plugins are isolated sandboxed JavaScript runtimes, the danmaku engine uses asynchronous layer rendering and a dedicated shoot scheduler to handle burst traffic, and the playback recovery coordinator implements a tunable ladder of fallback actions (reload, switch CDN, refresh play args) to handle stream stalls. The favorite syncing engine uses `CKSyncEngine` with actor-based concurrency and circuit breakers to avoid retry storms. The codebase also includes a comprehensive test suite covering plugin operation, playback recovery, danmaku connection reconnection, and favorite refresh policies. Key entry points for the iOS app are `AngelLiveApp.swift` and `ContentView.swift`, which manage navigation and deep link handling. The macOS app uses `TabView` with sidebar navigation, and the tvOS app uses a SwiftUI-based sidebar and focusable grid. The developer console (`PluginConsoleView`) provides real-time logging and filtering of plugin calls, which is useful for debugging and extending the platform support. The app supports DLNA casting via SSDP discovery and a local HTTP proxy, and it integrates with AirPlay and Picture-in-Picture. Overall, AngelLive is a well-engineered, production-quality application with a clear separation of concerns, strong test coverage, and a plugin architecture that allows it to adapt to new platforms without modifying the core app. Its design patterns—such as the actor-based credential manager, the state machine for playback recovery, and the modular danmaku engine—are candidates for extraction into other projects.
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.