$ show hxh19950701/WebViewTvLive
WebViewTvLive is an Android TV live streaming application that uses the Tencent X5 WebView to display official TV channel web pages. It loads channel playlists from remote JSON sources, caches them locally, and provides a TV-optimized UI with remote control and touch input support. The app employs a per-site adapter pattern (WebpageAdapter) to inject JavaScript and trigger fullscreen playback for different streaming websites (e.g., CCTV, YouTube, MGTV). It features a channel bar, waiting indicator, settings for aspect ratio and source selection, and automatic playlist updates. The codebase is well-structured with separation of playlist management, settings, and UI, but the project is officially paused as open source, with the last released version being 1.6. Dependencies are reasonably up-to-date, though some deprecated Android APIs are used.
The LLM identified 2 files worth highlighting for reuse:
Provides a generic mechanism to download a JSON list of channels from a configurable URL, cache it locally with expiration, and notify listeners on changes. It handles retry logic and uses OkHttp for network calls. This module is isolated (depends only on application context and SharedPreferences) and could be extracted for any project needing a simple remote data list with local caching.
A reusable JavaScript template injected into WebView pages to automatically detect video elements, enter fullscreen, and report video size progress. It uses a polling loop to find elements by CSS selector and handles playing state checks. This script is self-contained and can be adapted for any WebView-based video playback project by replacing placeholder selectors.