Skip to content

Commit

Permalink
Fix iOS load bug with out of range index.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanheise committed Nov 18, 2020
1 parent 15c77fd commit 62fe5b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion just_audio/darwin/Classes/AudioPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ - (int)getBufferedPosition {
}

- (int)getDuration {
if (_processingState == none) {
if (_processingState == none || _processingState == loading) {
return -1;
} else if (_indexedAudioSources && _indexedAudioSources.count > 0) {
int v = (int)(1000 * CMTimeGetSeconds(_indexedAudioSources[_index].duration));
Expand Down

0 comments on commit 62fe5b6

Please sign in to comment.