playerctl 1.2.0
playerctl: ^1.2.0 copied to clipboard
A Flutter plugin for Linux that provides robust media playback control using playerctl CLI with multi-player support and automatic error recovery.
Changelog #
All notable changes to this project will be documented in this file.
1.2.0 #
- Major Features:
- Level-wise Logging System
- Added
PlayerctlLoggerwith configurable log levels - Log levels:
none,error,warning,info,debug - Emoji-based categorization (đ DEBUG, âšī¸ INFO, â ī¸ WARNING, â ERROR, â SUCCESS, etc.)
- Context tags for better log organization
- Production-ready with silent mode
- 4 ways to configure logging:
- Global:
PlayerctlLogger.level = LogLevel.info - Constructor:
MediaPlayerManager(logLevel: LogLevel.info) - Runtime via manager:
manager.setLogLevel(LogLevel.error) - Runtime via logger:
PlayerctlLogger.level = LogLevel.warning
- Global:
- Automatic defaults: debug mode = verbose, release mode = errors only
- Special log categories: METADATA (đĩ), PLAYER (đ), VOLUME (đ), SYNC (đ), NETWORK (đ)
- Added
- Added
logLevelgetter to MediaPlayerManager - Added
setLogLevel()method to MediaPlayerManager for runtime configuration - Created comprehensive logging documentation (
LOGGING.md) - Added interactive logging configuration example (
logging_config_example.dart)
- Level-wise Logging System
- Improvements:
- Replaced all
debugPrintcalls with structured logging - Better error context with exception objects
- Cleaner console output with categorized messages
- Enhanced MediaPlayerManager constructor to accept optional log level
- Replaced all
- All tests passing (20 tests)
1.1.1 #
- Bug Fixes:
- Fixed metadata not syncing to UI (Critical Fix)
- Fixed bidirectional player name matching in
_updateMediaInfo - Handles mismatch between
--list-all(returnsbrave.instance3723) and{{playerName}}(returnsbrave) - Added debug logging for metadata filtering (
đ,â,â ī¸indicators) - Metadata stream was working but updates were being rejected due to name mismatch
- Now properly matches both
selected="brave.instance3723"withmetadata="brave"and vice versa
- Fixed bidirectional player name matching in
- Fixed metadata not syncing to UI (Critical Fix)
- All tests passing (20 tests)
1.1.0 #
- Major Features:
- Seek/scrub functionality for playback position control
getPosition()- Get current playback position in microsecondsseekTo(int positionMicroseconds)- Seek to absolute positionseek(int offsetMicroseconds)- Seek relative to current position (supports positive/negative offset)seekForward(int seconds)- Convenience method to skip forward by secondsseekBackward(int seconds)- Convenience method to skip backward by seconds- All seek methods support optional player parameter for multi-player control
- Position values in microseconds for precision (MPRIS standard)
- Returns
trueon success,falseon failure - Error handling with try-catch blocks
- Added seek operations across all layers:
PlaybackController,PlayerctlService, andMediaPlayerManager
- Local HTTP server for album art
- Added
AlbumArtServer- HTTP server running on0.0.0.0:8765 - Automatically converts file:// URLs to local HTTP URLs (e.g.,
http://0.0.0.0:8765/art/935c12.jpg) - Access album art from other devices by replacing
0.0.0.0with your machine's IP address - Example:
http://0.0.0.0:8765/art/abc123.jpgâhttp://192.168.1.100:8765/art/abc123.jpg - Spotify and other online URLs (https://) remain unchanged
- Server starts automatically when metadata is fetched
- Server stops automatically when metadata provider is disposed
- Supports JPEG, PNG, GIF, WebP, BMP, and SVG formats
- CORS enabled for cross-origin requests
- File caching for efficient serving
- Health check endpoint at
/
- Added
- Multi-player data streaming
- New
allPlayersMediamap inPlayerStatecontainingMediaInfofor all active players - Automatically fetches metadata for all available players simultaneously
- Updates all players' data every 3 seconds (along with selected player's real-time stream)
- Access any player's media info via
state.allPlayersMedia['playerName'] - Useful for displaying multiple players' status in UI
- Updated
PlayerStatewithallPlayersMediafield - Included in JSON serialization/deserialization and equality comparisons
- Backward compatible - defaults to empty map
- Enhanced
_refreshAllPlayersMetadata()method for batch metadata fetching
- New
- Auto-pause other players feature
- When calling
play(),playPause(),next(), orprevious(), all other playing players are automatically paused - Prevents audio conflicts and glitching when multiple players are active
- Added
_pauseOtherPlayers()helper method - Only pauses players that are currently in "Playing" status
- When calling
- Seek/scrub functionality for playback position control
- Bug Fixes:
- Fixed album art images trying to download instead of displaying inline
- Added
Content-Disposition: inlineheader to HTTP server - Added cache control headers for better performance
- Added
- Fixed glitching when switching to inactive players
- Clear stale media data immediately on player switch
- Stop all sync timers before switching
- Reduced delay and improved state transitions
- Fixed metadata from other players overwriting current display
- Added player name filtering in
_updateMediaInfo - Matches player instance names (e.g., "brave.instance123")
- Added player name filtering in
- Fixed multiple players playing simultaneously
- Automatically pauses other players when starting playback
- Applied to
play(),playPause(),next(), andprevious()methods
- Added missing seek methods to
MediaPlayerManager- Full seek functionality now available in manager API
- Fixed album art images trying to download instead of displaying inline
- Testing:
- Added comprehensive test case for multi-player data verification
- All tests passing (20 tests)
1.0.4 #
- Added album cover/art URL support (
artUrlfield inMediaInfo)- Fetches
mpris:artUrlfrom playerctl metadata - Included in JSON serialization/deserialization
- Included in equality comparisons and change detection
- Available for displaying album artwork in UI
- Fetches
- All tests passing (19 tests)
1.0.3 #
- Breaking Change: Implemented Equatable for all models (
PlayerStateandMediaInfo)- Removed manual
==operator andhashCodeimplementations - More efficient and reliable equality comparisons
- Better performance for state management solutions
- Added
equatablepackage as dependency
- Removed manual
- Added stream optimization: metadata changes only emit when actual changes occur (ignores position updates)
- Significantly reduces unnecessary UI updates
- Ignores position changes that happen constantly during playback
- Only emits when title, artist, album, status, player, or length changes
- Fixed test for invalid volume range to expect exception instead of false
- All tests passing (19 tests)
1.0.2 #
- Breaking Change: Implemented Equatable for all models (
PlayerStateandMediaInfo)- Removed manual
==operator andhashCodeimplementations - More efficient and reliable equality comparisons
- Better performance for state management solutions
- Removed manual
- Added stream optimization: metadata changes only emit when actual changes occur (ignores position updates)
- Added JSON serialization support (
toJsonandfromJson) toPlayerStateandMediaInfo - Added platform specification to pubspec.yaml (Linux only)
- Fixed test for invalid volume range to expect exception instead of false
- Code formatting improvements and cleanup
- Enhanced type safety in JSON parsing with null checks
1.0.1 #
- Updated package description for better clarity
- Refined documentation and LICENSE file
- Minor cleanup and improvements
1.0.0 #
- Initial stable release
- State-agnostic core architecture with SOLID principles
- Real-time metadata streaming with automatic process restart (up to 5 attempts)
- Triple-layer synchronization (stream + metadata refresh + volume sync)
- Multi-player support with automatic player switching
- Shuffle and loop controls with cycle support
- Volume synchronization detects external changes
- Robust error handling and automatic recovery
- Optional GetX wrapper for reactive state management
- Special character support in metadata (handles pipe characters correctly)
- Debounced player switching prevents glitches during rapid changes