I am implementing AVAudioPlayer and fast-rewind,fast-forward functionality. I have made two button with gesture, images and glow effects. Currently when I tab on fast-forwar
You can use an AVPlayer
instead and change the rate property on touch down.
Change it to -2 for rewind and 2 for fast-forward.
And remember to change the rate back to 1 on touch up inside/outside.
EDIT AVPlayer
's rate
property supports values outside the 0.0
-1.0
range IF
the associated player item returns YES for the AVPlayerItem properties canPlaySlowForward or canPlayFastForward
https://developer.apple.com/documentation/avfoundation/avplayer/1388846-rate
One possible solution is to implement the repeating action by an NSTimer. Have a look at UIButton Touch and Hold.