diff --git a/just_audio/CHANGELOG.md b/just_audio/CHANGELOG.md index 394865da..09f36b93 100644 --- a/just_audio/CHANGELOG.md +++ b/just_audio/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.9.41 + +* Fix stop() to cause play() to return on iOS. + ## 0.9.40 * Fix JDK 21 compile error. diff --git a/just_audio/darwin/Classes/AudioPlayer.m b/just_audio/darwin/Classes/AudioPlayer.m index d22719d0..0214563b 100644 --- a/just_audio/darwin/Classes/AudioPlayer.m +++ b/just_audio/darwin/Classes/AudioPlayer.m @@ -1330,6 +1330,15 @@ - (void)dispose { if (!_player) return; if (_processingState != none) { [_player pause]; + + [self updatePosition]; + [self broadcastPlaybackEvent]; + if (_playResult) { + //NSLog(@"PLAY FINISHED DUE TO STOP"); + _playResult(@{}); + _playResult = nil; + } + _processingState = none; // If used just before destroying the current FlutterEngine, this will result in: // NSInternalInconsistencyException: 'Sending a message before the FlutterEngine has been run.' diff --git a/just_audio/pubspec.yaml b/just_audio/pubspec.yaml index 51711071..bc8987a8 100644 --- a/just_audio/pubspec.yaml +++ b/just_audio/pubspec.yaml @@ -1,6 +1,6 @@ name: just_audio description: A feature-rich audio player for Flutter. Loop, clip and concatenate any sound from any source (asset/file/URL/stream) in a variety of audio formats with gapless playback. -version: 0.9.40 +version: 0.9.41 repository: https://github.com/ryanheise/just_audio/tree/minor/just_audio issue_tracker: https://github.com/ryanheise/just_audio/issues topics: