I am working on AVPlayer. I am done with Pause, Play and fastForward of the playing audio stream. I want to change the playing speed of audio stream while playing. I have searched a lot, but not getting accurate direction. So, help me with this.
The current rate of playback.
var rate: Float
Docs
https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVPlayer_Class/#//apple_ref/occ/instp/AVPlayer/rate
A value of 0.0 means pauses the video, while a value of 1.0 play at the natural rate of the current item. Rates other than 0.0 and 1.0 can be used if the associated player item returns YES for the AVPlayerItem properties canPlaySlowForward or canPlayFastForward. Negative rate value ranges are supported if the player item returns YES for the canPlayReverse, canPlaySlowReverse, and canPlayFastReverse properties.
You can increase or decrease the rate by this single line code:
// change the rate
Avplayer.playImmediately(atRate: 1.25)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With