From b18157ebee251932a0faacefebbdf0ae65a5d863 Mon Sep 17 00:00:00 2001 From: subhash279 Date: Sun, 13 Sep 2020 18:08:26 +0530 Subject: [PATCH] bug fix for audio seek when playback speed > 1.0 (#176) * bug fix for audio seek when playback speed > 1.0 * rate fix for iOS < 10 * rm play --- darwin/Classes/AudioPlayer.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/darwin/Classes/AudioPlayer.m b/darwin/Classes/AudioPlayer.m index 3b536b0..3d46f0f 100644 --- a/darwin/Classes/AudioPlayer.m +++ b/darwin/Classes/AudioPlayer.m @@ -1105,7 +1105,11 @@ // If playing, buffering will be detected either by: // 1. checkForDiscontinuity // 2. timeControlStatus - [_player play]; + if (@available(iOS 10.0, *)) { + [_player playImmediatelyAtRate:_speed]; + } else { + _player.rate = _speed; + } } else { // If not playing, there is no reliable way to detect // when buffering has completed, so we use