media_browser 1.0.1
media_browser: ^1.0.1 copied to clipboard
A Flutter plugin to browse and query local media files including audio, video, documents, and folders from device storage with filtering and sorting capabilities.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.1 2024-12-XX #
Added #
-
Enhanced Data Models
AlbumModel,ArtistModel,GenreModelclasses for structured data- Enhanced
AudioModelwith artwork property MediaRepositoryfor centralized data accessBrowsingServicefor context-aware browsing with state managementPlaylistModelfor full playlist management with CRUD operations
-
Media Player Services
MediaPlayerServiceclass with comprehensive playback functionality- Gapless playback using
ConcatenatingAudioSourcefor seamless track transitions - Playlist management with load, add, clear, and shuffle operations
- Real-time state management with streams for player state, position, duration, and current track
- Volume control and seek functionality
- Shuffle mode with proper index management
Changed #
- Plugin Architecture: Moved UI-specific components (image caching, artwork widgets) from plugin to example app for better separation of concerns
- Dependencies: Added
just_audio: ^0.9.36dependency for media playback functionality
Fixed #
- Artwork Loading: Fixed base64 encoding issues with
Base64.NO_WRAPto prevent corruption - Compilation Errors: Fixed missing method references and import issues
- Lint Warnings: Resolved all linter warnings and errors
Technical Improvements #
- Error Handling: Enhanced error handling for artwork loading
- Code Organization: Better separation of concerns between plugin and UI layers
- Plugin Structure: Cleaner plugin structure with UI components properly separated
Dependencies Added #
just_audio: ^0.9.36for media playback functionality
1.0.0 2024-01-XX #
Added #
-
Audio Support
- Query audio files with comprehensive metadata (title, artist, album, genre, duration, etc.)
- Filter by audio type (music, ringtones, alarms, notifications, podcasts, audiobooks)
- Support for multiple audio formats (MP3, AAC, FLAC, WAV, OGG, M4A, WMA, AMR, OPUS)
- Query by album, artist, genre, or specific path
- Advanced sorting options for audio files
-
Video Support
- Query video files with metadata (title, resolution, duration, codec, etc.)
- Filter by video type (movies, TV shows, music videos, trailers)
- Support for multiple video formats (MP4, AVI, MKV, MOV, WMV, FLV, WebM, M4V, MPG, MPEG, M2V, MTS, M2TS, TS, VOB)
- Resolution and bitrate information
- Frame rate and codec details
- Query from specific paths
-
Document Support
- Query document files with metadata (title, author, subject, page count, etc.)
- Support for various document types (PDF, DOC, DOCX, TXT, RTF, XLS, XLSX, PPT, PPTX, CSV, XML, HTML, EPUB, MOBI, AZW)
- E-book support (EPUB, MOBI, AZW)
- Language and word count information
- Encryption and compression status
- Query from specific paths
-
Folder Support
- Query folder/directory information
- File and directory counts
- Total size calculation with formatted display
- Folder type classification (music, video, documents, pictures, downloads, DCIM, movies, podcasts, audiobooks, ringtones, notifications, alarms, system, cache, temp, other)
- Storage location information (internal, external, SD card, USB, cloud, network, other)
- Query from specific paths
-
Artwork Support
- Extract artwork/thumbnails for audio and video files
- Multiple size options (small, medium, large, original)
- Support for various image formats (JPEG, PNG, WebP, BMP, GIF)
- Cached artwork management with clear functionality
- Artwork type classification (audio, video, album, artist, genre, playlist, folder)
-
Advanced Filtering System
- File size range filtering with helper methods (smallerThan, largerThan, between, exact)
- Date range filtering with helper methods (after, before, between)
- File extension inclusion/exclusion lists
- MIME type filtering with inclusion/exclusion lists
- Search query support with case-insensitive option
- Hidden and system file options
- Audio-specific filters (duration range, artist, album, genre filters)
- Video-specific filters (resolution range, duration range)
-
Comprehensive Sorting Options
- Multiple sort types for each media category
- Ascending/descending order with case-insensitive option
- Audio sort types: title, artist, album, genre, duration, size, dateAdded, dateModified, track, year, albumArtist, composer, fileExtension, displayName
- Video sort types: title, artist, album, genre, duration, size, dateAdded, dateModified, width, height, year, fileExtension, displayName, codec, bitrate, frameRate
- Document sort types: title, size, dateAdded, dateModified, fileExtension, displayName, author, subject, pageCount, wordCount, language
- Folder sort types: name, path, dateCreated, dateModified, dateAccessed, totalSize, fileCount, directoryCount
- Generic media sort types: title, size, dateAdded, dateModified, fileExtension, displayName, mimeType
-
Data Models
AudioModelwith comprehensive audio metadataVideoModelwith video-specific metadata and resolution informationDocumentModelwith document-specific metadata and type classificationFolderModelwith folder information and storage location detailsArtworkModelwith artwork data and format informationQueryOptionsbase class for filtering and sortingAudioQueryOptionswith audio-specific filtering optionsVideoQueryOptionswith video-specific filtering options
-
Enums and Constants
MediaTypeenumeration (audio, video, document, image, folder, archive, other)DocumentTypeenumeration (pdf, doc, docx, txt, rtf, xls, xlsx, ppt, pptx, csv, xml, html, epub, mobi, azw, image, archive, other)FolderTypeenumeration (music, video, documents, pictures, downloads, dcim, movies, podcasts, audiobooks, ringtones, notifications, alarms, system, cache, temp, other)StorageLocationenumeration (internal, external, sdCard, usb, cloud, network, other)ArtworkTypeenumeration (audio, video, album, artist, genre, playlist, folder)ArtworkFormatenumeration (jpeg, png, webp, bmp, gif, other)ArtworkSizeenumeration (small, medium, large, original)SortOrderenumeration (ascending, descending)- Comprehensive sort type enumerations for each media type
- File format constants for audio, video, document, image, and archive formats
-
Platform Interface
- Abstract
SimpleMediaQueryPlatformclass with all method signatures MethodChannelSimpleMediaQueryimplementation for method channel communication- Permission management (request and check permissions)
- Media scanning functionality
- Device information retrieval
- Abstract
-
Main Plugin Class
SimpleMediaQuerymain class with all public methods- Comprehensive API for all media types
- Easy-to-use interface with optional parameters
- Error handling and null safety
-
Example Application
- Complete example app demonstrating all features
- Tabbed interface for different media types
- Permission handling with user-friendly UI
- Detailed media information display
- Search and filtering examples
- Artwork display functionality
-
Documentation
- Comprehensive README with usage examples
- API documentation for all classes and methods
- Installation and setup instructions
- Permission requirements for Android and iOS
- Supported file formats documentation
- Platform support information
Technical Features #
- Null Safety: Full null safety support for Dart 3.0+
- Type Safety: Strong typing with comprehensive data models
- Error Handling: Proper error handling with try-catch blocks
- Performance: Efficient querying with filtering and sorting options
- Extensibility: Modular design allowing easy extension for new media types
- Cross-Platform: Support for Android and iOS with method channels
- Memory Management: Cached artwork management with clear functionality
API Methods #
getPlatformVersion()- Get platform version informationrequestPermission()- Request storage permissionshasPermission()- Check if permissions are grantedqueryAudios()- Query audio files with optional filteringqueryAudiosFromAlbum()- Query audio files from specific albumqueryAudiosFromArtist()- Query audio files from specific artistqueryAudiosFromGenre()- Query audio files from specific genrequeryAudiosFromPath()- Query audio files from specific pathqueryVideos()- Query video files with optional filteringqueryVideosFromPath()- Query video files from specific pathqueryDocuments()- Query document files with optional filteringqueryDocumentsFromPath()- Query document files from specific pathqueryFolders()- Query folder information with optional filteringqueryFoldersFromPath()- Query folders from specific pathqueryAlbums()- Query album informationqueryArtists()- Query artist informationqueryGenres()- Query genre informationqueryArtwork()- Query artwork/thumbnails for media filesclearCachedArtworks()- Clear cached artwork datascanMedia()- Scan media files in specific pathgetDeviceInfo()- Get device information
Supported Platforms #
- ✅ Android (API 21+)
- ✅ iOS (iOS 11.0+)
- ⚠️ Web (Limited support - planned for future versions)
- ⚠️ macOS (Limited support - planned for future versions)
- ⚠️ Windows (Limited support - planned for future versions)
- ⚠️ Linux (Limited support - planned for future versions)
Dependencies #
- Flutter SDK 3.0.0+
- plugin_platform_interface 2.0.2+
Breaking Changes #
- None (initial release)
Migration Guide #
- N/A (initial release)
Future Releases #
Planned Features #
- Web Support: Full web platform support with file system access
- Desktop Support: Native desktop platform support (macOS, Windows, Linux)
- Playlist Management: Create, edit, and manage playlists
- Media Editing: Basic media metadata editing capabilities
- Cloud Storage: Support for cloud storage providers
- Advanced Search: Full-text search across media metadata
- Batch Operations: Bulk operations for media files
- Media Streaming: Basic media streaming capabilities
- Export/Import: Export and import media collections
- Statistics: Media usage statistics and analytics
Performance Improvements #
- Lazy loading for large media collections
- Background processing for media scanning
- Optimized database queries
- Memory usage optimization
- Caching improvements
API Enhancements #
- Stream-based queries for real-time updates
- Observer pattern for media changes
- Advanced filtering with regex support
- Custom sort functions
- Pagination support for large result sets