Smart TV
Open Source

Smart TV Local Media Player: Flutter D-Pad Client

DartFlutterGoRouterVideoPlayerWakelockPlusFocusNode API

A bespoke Android TV media client engineered in Flutter. Features a custom spatial D-Pad focus management engine, asynchronous network streaming, and hardware-level wakelock integration, designed to interface directly with a high-performance Rust backend.

Tech Stack

DartFlutterGoRouterVideoPlayerWakelockPlusFocusNode API

System Metrics

Zero dropped frames during playback via strictly isolated `ValueListenableBuilder` rendering streams
Deterministic memory footprint achieved by disposing and re-allocating `FocusNode` arrays exclusively upon directory traversal
Near-instant UI updates by bypassing heavy state management frameworks in favor of highly localized `setState` trees

Why Did I Build This?

"Standard Android media players often suffer from poor D-Pad support, bloated UIs, and a reliance on heavy backend indexers (like Plex or Jellyfin). I engineered this Flutter client specifically for Android TV to provide a zero-latency, highly responsive local media streaming experience. By tightly coupling it with my custom Rust backend, I eliminated the need for heavy middleware, ensuring immediate playback and fluid hardware remote navigation."

Architecture & Decisions

The application relies heavily on Flutter's `FocusNode` API to construct a deterministic, grid-based spatial navigation matrix for TV remote controls. To prevent frame drops during high-frequency video playback updates, state mutations are localized using `ValueListenableBuilder` rather than rebuilding the entire widget tree. Network requests are handled asynchronously via standard HTTP protocols, mapping JSON responses directly into strongly-typed Dart models. The video pipeline leverages the native `video_player` plugin, wrapped in a custom UI overlay that auto-hides and captures low-level keyboard interrupts for precise seek-bar scrubbing and playback control.

Key Features

  • 01.Spatial D-Pad navigation matrix utilizing explicit `FocusNode` hardware event interception
  • 02.Immersive Kiosk mode enforcement (`SystemUiMode.immersiveSticky`) for native TV UX
  • 03.Asynchronous media indexing and folder traversal via REST API
  • 04.Hardware wakelock management to prevent OS sleep states during prolonged playback
  • 05.Optimized player overlay with auto-hide timers and relative seek interpolation
This client represents a masterclass in spatial UI engineering for non-touch environments. Interfacing gracefully with Android TV requires bypassing standard mobile touch paradigms; thus, the architecture manually intercepts low-level hardware keyboard events (LogicalKeyboardKey) to route visual focus. When paired with the zero-copy Rust backend, the entire stack bypasses traditional streaming bottlenecks, delivering enterprise-grade performance on standard local network hardware.