background_runtime_windows

Windows implementation of the background_runtime Flutter plugin.

Capabilities

  • Downloads: WinHTTP-based async download engine with progress callbacks, pause/cancel, and JSON persistence.
  • Audio playback: Best-effort via ShellExecuteW (opens URL in default media player). Full WinRT integration planned.
  • Notification actions: Low-level keyboard hook (WH_KEYBOARD_LL) for media keys (Previous/Next/PlayPause/Stop). Registered via dev.mixin27.background_runtime/notificationActionEvents event channel.
  • Album art: Parsed from AudioTrack.albumArt, persisted in audio_track.json, included in player state events.
  • State persistence: JSON files in %LOCALAPPDATA%\background_runtime\ for downloads, audio tracks, and config. Auto-resume on initialize.

Known Limitations

  • Audio playback opens external player (no in-process audio yet).
  • Pause simulates cancellation with state save (true pause requires WinRT).
  • Keyboard hook captures media keys system-wide when enabled.