background_runtime_web 0.1.1
background_runtime_web: ^0.1.1 copied to clipboard
Web implementation of the background_runtime plugin.
background_runtime_web #
Web implementation of the background_runtime Flutter plugin.
Best-effort support. Some native features (foreground service, persistent notifications) are unavailable on the web platform.
Capabilities #
- Downloads: Triggers browser download via anchor element (no CORS restrictions, no progress tracking).
- Audio playback: HTMLAudioElement with explicit
play()and autoplay policy handling. - Notification actions: Media Session API (
previoustrack/nexttrack/play/pause/stop) with keyboard media-key fallback. - Album art: Set as
MediaMetadataartwork whenAudioTrack.albumArtis provided. - Lifecycle events: Reports
initializedandterminatedstates.
Known Limitations #
- No true background execution (browsers do not support it).
- Audio playback stops when the page is hidden on mobile.
- Downloads cannot be paused or resumed.
- Previous/next actions require Media Session API support or media keys.
- Download progress tracking is not available (best-effort).