Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stop() to cause play() to return on iOS. #1339

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions just_audio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.9.41

* Fix stop() to cause play() to return on iOS.

## 0.9.40

* Fix JDK 21 compile error.
Expand Down
9 changes: 9 additions & 0 deletions just_audio/darwin/Classes/AudioPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,15 @@ - (void)dispose {
if (!_player) return;
if (_processingState != none) {
[_player pause];

[self updatePosition];
[self broadcastPlaybackEvent];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Facing this issue the app crashes when I close it. could it be because of this line change?
-[AudioPlayer broadcastPlaybackEvent]
NSInternalInconsistencyException - Sending a message before the FlutterEngine has been run.

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.'
Expand Down
2 changes: 1 addition & 1 deletion just_audio/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down