Skip to content

Commit

Permalink
Merge branch 'fix/ios_load_npe' into minor
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanheise committed Dec 15, 2024
2 parents 3d3815f + b7e3449 commit f116d4a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
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.43

* Fix NPE in load on iOS/macOS.

## 0.9.42

* Fix dealloc crash on iOS/macOS (@cristian1980).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,10 @@ public void onMethodCall(final MethodCall call, final Result result) {
}
} catch (IllegalStateException e) {
e.printStackTrace();
result.error("Illegal state: " + e.getMessage(), null, null);
result.error("Illegal state: " + e.getMessage(), e.toString(), null);
} catch (Exception e) {
e.printStackTrace();
result.error("Error: " + e, null, null);
result.error("Error: " + e, e.toString(), null);
} finally {
broadcastPendingPlaybackEvent();
}
Expand Down
4 changes: 2 additions & 2 deletions just_audio/darwin/Classes/AudioPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,8 @@ - (void)load:(NSDictionary *)source initialPosition:(CMTime)initialPosition init
[_indexedAudioSources[i] attach:_player initialPos:(i == _index ? initialPosition : kCMTimeInvalid)];
}

if (_indexedAudioSources.count == 0 || !_player.currentItem ||
_player.currentItem.status == AVPlayerItemStatusReadyToPlay) {
if (_loadResult && (_indexedAudioSources.count == 0 || !_player.currentItem ||
_player.currentItem.status == AVPlayerItemStatusReadyToPlay)) {
_processingState = ready;
_loadResult(@{@"duration": @([self getDurationMicroseconds])});
_loadResult = nil;
Expand Down
2 changes: 1 addition & 1 deletion just_audio/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
dependencies:
flutter:
sdk: flutter
audio_session: ^0.1.14
audio_session: ^0.1.23
rxdart: ^0.28.0
just_audio_mpv: ^0.1.6
just_audio_windows: ^0.2.0
Expand Down
4 changes: 2 additions & 2 deletions 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.42
version: 0.9.43
repository: https://github.com/ryanheise/just_audio/tree/minor/just_audio
issue_tracker: https://github.com/ryanheise/just_audio/issues
topics:
Expand All @@ -20,7 +20,7 @@ dependencies:
just_audio_web: ^0.4.11
# just_audio_web:
# path: ../just_audio_web
audio_session: ^0.1.14
audio_session: ^0.1.23
rxdart: '>=0.26.0 <0.29.0'
path: ^1.8.0
path_provider: ^2.0.0
Expand Down
2 changes: 1 addition & 1 deletion just_audio_background/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
dependencies:
flutter:
sdk: flutter
audio_session: ^0.1.14
audio_session: ^0.1.23
rxdart: ^0.27.2
just_audio:
path: ../../just_audio
Expand Down
2 changes: 1 addition & 1 deletion just_audio_background/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
# just_audio_platform_interface:
# path: ../just_audio_platform_interface
audio_service: ^0.18.14
audio_session: ^0.1.20
audio_session: ^0.1.23
flutter:
sdk: flutter
flutter_web_plugins:
Expand Down

0 comments on commit f116d4a

Please sign in to comment.