just_audio_windows_plus 0.4.0 copy "just_audio_windows_plus: ^0.4.0" to clipboard
just_audio_windows_plus: ^0.4.0 copied to clipboard

High-performance, seamless audio player for Flutter on Windows. Effortlessly play audio files, live streams, and playlists powered by native C++20 WinRT MediaPlayer.

0.4.0 #

  • Linear Permutation Shuffle Engine: Replaced quadratic index-shifting with an $O(N)$ permutation mapping (ReorderByShuffleOrder). Validates bounds, enforces element uniqueness, and rejects malformed shuffle arrays without corrupting playlist state.
  • Buffering Progress Clamping & NaN Defense: Introduced ClampBufferedPosition with std::isfinite validation. Safely bounds buffer calculations within [0, duration], eliminating C++ undefined behavior and Dart assertion failures caused by transient NaN or >1.0 progress values during live streaming.
  • Atomic Concurrency Synchronization: Upgraded source_set_, loop_mode_, and shuffle_mode_ to std::atomic in player.hpp, eliminating data races between background WinRT threadpool callbacks and Flutter UI thread method calls.
  • Negative Seek Protection: Enforced std::max<int64_t>(0, microseconds) in seekToPosition to prevent native WinRT E_INVALIDARG (0x80070057) exceptions.
  • Observable Native Error Logging & Brand Modernization: Modernized all native diagnostic logs and error reporting macros to [just_audio_windows_plus], replacing silent empty catch (...) {} blocks across primary playback and playlist operations (play, pause, stop, setVolume, setSpeed, setLoopMode, setShuffleMode, setShuffleOrder, seekToItem, seekToPosition) with JAW_ERROR macros logging to std::cerr for clear diagnostic visibility without crashing.
  • Method Arguments Null Safety: Added defensive null-check guards across all parameterized method calls (load, seek, setVolume, setSpeed, setLoopMode, setShuffleMode, setShuffleOrder, concatenatingInsertAll, concatenatingRemoveRange, concatenatingMove), returning descriptive channel errors instead of crashing from native null pointer dereferences.
  • Source State Transition Integrity: Deferred source_set_ state settlement until after source loading and initial seek settle successfully, with guaranteed rollback to false on any failure or disposal to prevent the player from getting stuck in loading (state 1).
  • Thread-Safe Dispatcher Teardown & Worker Thread Isolation: Synchronized window teardown and queue clearing under mutex in ~PlatformThreadDispatcher(). Hardened OnPlatformThread to safely drop and trace events if the dispatcher is unavailable, strictly preventing background WinRT worker threads from invoking Flutter binary messenger or event sinks off the UI platform thread.
  • Unified Sovereign C++ Architecture: Renamed internal implementation to windows/just_audio_windows_plus_plugin.cpp and class to JustAudioWindowsPlusPlugin. Cleaned legacy exports to export exclusively JustAudioWindowsPlusPluginRegisterWithRegistrar.
  • Native C++ CI Quality Gate: Added automated Windows debug build (flutter build windows --debug) in GitHub Actions ci.yml to continuously verify MSVC compilation and C++ linkage.
  • Native Unit Test Suite: Added GoogleTest test cases in uri_utils_test.cpp covering shuffle permutations, duplicate rejection, and buffer clamping edge cases.

0.3.0 #

  • 64-bit Timestamp Safety: Introduced TryGetInt64 across all seeking, duration, and playlist mutations. StandardMessageCodec encodes timestamps exceeding 35.7 minutes ($2^{31}-1$ microseconds) as int64_t, which previously failed silently under 32-bit std::get_if<int>.
  • Exact Microsecond Precision: Replaced lossy truncated millisecond arithmetic with exact 64-bit microsecond conversions (TimeSpanToMicroseconds), preserving sub-millisecond timeline accuracy.
  • Event Channel Teardown Hygiene: Explicitly unregistered binary message handlers in JustAudioEventSink destructor to eliminate dangling callbacks and post-disposal access violations (0xC0000005).
  • Defensive Playlist Mutations & Bounds: Fully bounds-checked concatenatingMove, concatenatingInsertAll, and concatenatingRemoveRange to eliminate native WinRT E_BOUNDS exceptions during rapid playlist modifications.
  • Accurate Looping & Shuffling: Ensured LoopMode.all loops single tracks seamlessly and synchronized internal loopMode and shuffleMode state broadcasts back to Flutter.
  • Native MediaEnded Event: Subscribed to WinRT MediaPlayer.MediaEnded for instantaneous completed state signaling upon track finish.
  • Clipping Audio Source Hardening: Enforced non-negative start offsets and validated duration boundaries for ClippingAudioSource.
  • Clean Codebase Hygiene: Removed obsolete legacy files (url_code.hpp) and unused methods (GetPlayerByPlayerId).
  • Pub.dev Package Showcase: Added official package screenshots metadata in pubspec.yaml.

0.2.0 #

  • Platform Thread Dispatcher: Marshals all WinRT event callbacks (PlaybackStateChanged, MediaFailed, CurrentItemChanged, ItemFailed) onto Flutter's UI platform thread via a Win32 message-only window (HWND_MESSAGE). Completely eliminates engine warnings: channel sent a message from native to Flutter on a non-platform thread.
  • C++20 Toolchain Upgrade: Built with CMAKE_CXX_STANDARD 20 to fix compilation error C2338 / STL1011 under Visual Studio 2026 / MSVC 14.51 where experimental coroutines are deprecated.
  • Defensive Playlist Transitions: Eliminates crashes and buffering errors when skipping tracks rapidly in ConcatenatingAudioSource. Removed premature broadcastState() in seekToItem() and defensively guarded NaturalDuration, Position, and BufferingProgress WinRT property queries.
  • Source Swap Interruption Fix: Fixes PlayerInterruptedException('Loading interrupted') on source swaps by preventing gaps during playlist clearing from being falsely reported as idle.
  • Duration Gated Completion: Requires NaturalDuration() > 0 before emitting completed (state 4), preventing freshly loaded clips from prematurely reporting completed.
  • Robust Exception Handling: Catches winrt::hresult_error and std::exception in load and method calls, returning proper Dart errors instead of crashing the process via std::terminate.
  • SMTC De-conflict: Disables mediaPlayer.CommandManager().IsEnabled(false) to prevent blank OS media overlays and desynchronized hardware media keys.
  • Debug-Gated Tracing: Verbose method call logging is gated behind JAW_TRACE under #ifndef NDEBUG, preventing console flood in production.
  • Thread-Safe Mutex Hardening: Added std::mutex players_mutex_ for the global player registry and std::mutex sink_mutex_ for event sinks. Safely destroys players outside lock to eliminate 0xC0000005 Access Violations on player disposal, stop, and hot restart.
  • Full Drop-in Compatibility: Fully implements the just_audio platform interface for Windows.

0.1.0 #

  • Initial release of just_audio_windows_plus.
  • Thread-Safe EventSink: Synchronized Flutter EventSink calls via std::mutex to prevent concurrent writes from background WinRT threadpool worker threads.
  • Atomic Player Lifecycle: Introduced std::atomic<bool> disposed_ and std::recursive_mutex player_mutex_ to safely coordinate player destruction and prevent Use-After-Free Access Violations (0xC0000005).
  • Safe Plugin Registrar: Protected the global player registry (players_ vector) with a dedicated mutex during concurrent creations and disposals.
  • Defensive WinRT Property Probing: Wrapped NaturalDuration, BufferingProgress, and Position access in exception handlers to gracefully handle transient states during playlist transitions.
  • Full Drop-in Compatibility: Fully implements the just_audio platform interface for Windows.
2
likes
0
points
379
downloads

Publisher

verified publisheromar-afifi.com

Weekly Downloads

High-performance, seamless audio player for Flutter on Windows. Effortlessly play audio files, live streams, and playlists powered by native C++20 WinRT MediaPlayer.

Repository (GitHub)
View/report issues

Topics

#audio #windows #just-audio #audio-player #media-player

License

unknown (license)

Dependencies

flutter

More

Packages that depend on just_audio_windows_plus

Packages that implement just_audio_windows_plus