$ account pcccccc
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.