spotube/lib
S.B cee65b5f2f
Update audio_player.dart
Key Improvements:

    SpotubeMediaFactory: Handles the logic of creating SpotubeMedia instances, allowing for easier scalability and reducing repetitive code.

    Dependency Injection (DI): CustomPlayer is injected into the AudioPlayerInterface, improving testability and modularity.

    Helper Methods: Functions like getNetworkAddress() and getUriForTrack() simplify and centralize repeated logic, improving maintainability.

    Playback Control Methods: Added play(), pause(), stop(), and seek() methods for better playback control with error handling.

    PlaybackStateManager: Manages the state-related properties (isPlaying, duration, etc.), keeping the AudioPlayerInterface cleaner and more focused on playback control.

Advantages:

    Separation of Concerns: The code is now better structured with clear separation between media management (SpotubeMedia), playback state management (PlaybackStateManager), and playback controls (AudioPlayerInterface).

    Extensibility: The code is more scalable with the factory pattern, making it easy to add new track types or other media sources.

    Testability: With dependency injection, you can easily mock the CustomPlayer and test the logic of AudioPlayerInterface independently.

    Clean Code: Centralized logic and helper methods reduce code duplication, improving readability and maintainability.
2024-10-19 14:48:18 +02:00
..
collections chore: hide donations link for playstore version to adhere with Google Play's iae policy 2024-10-09 16:37:41 +06:00
components fix: playlist displaying descriptions unescaped html #1784 2024-09-15 17:45:57 +06:00
extensions fix: playlist displaying descriptions unescaped html #1784 2024-09-15 17:45:57 +06:00
hooks chore: upgrade to Flutter 3.24.3 2024-09-30 21:53:12 +06:00
l10n fix(translations): correct some basque incorrect translations (#1815) 2024-09-15 18:46:17 +06:00
models chore: remove old logger 2024-07-06 22:02:31 +06:00
modules fix(lyrics): LRCLIB lyrics should be usable without logging in #1803 2024-09-15 18:22:09 +06:00
pages chore: hide donations link for playstore version to adhere with Google Play's iae policy 2024-10-09 16:37:41 +06:00
provider fix(lyrics): LRCLIB lyrics should be usable without logging in #1803 2024-09-15 18:22:09 +06:00
services Update audio_player.dart 2024-10-19 14:48:18 +02:00
themes chore: update translations and refactor to flutter 3.22 ThemeData 2024-08-10 22:54:25 +06:00
utils feat: discord rpc for macOS, windows-arm64 and linux-arm64 (#1713) 2024-07-14 18:58:47 +06:00
generated_plugin_registrant.dart Playlist info editing (#708) 2023-09-10 16:39:21 +06:00
main.dart chore: fix detection isn't working as drag device enables drag 2024-08-18 13:04:45 +06:00