SwiftAudio icon indicating copy to clipboard operation
SwiftAudio copied to clipboard

Skipforward and skipforward issue

Open abdulrehman73331 opened this issue 5 years ago • 5 comments

I'm little confused can any one help me how to skip forward 30 sec and skip backword 30 sec on clicking button (IbAction)

abdulrehman73331 avatar May 26 '20 06:05 abdulrehman73331

get the current from your player obj ie -

var seekTime = player.currentTime

then add + 30 for forward and -30 for backward

kodekarim avatar May 27 '20 07:05 kodekarim

get the current from your player obj ie -

var seekTime = player.currentTime

then add + 30 for forward and -30 for backward

Hi since currentTime is get property only where I add +30 or - 30 sec

abdulrehman73331 avatar May 27 '20 07:05 abdulrehman73331

if i would have understood correctly , store the current time + 30 and add the update value on

for example if u want to do forward

var seekTime = player.currentTime + 30
player.seek(to: Double(seekTime))

this will forward your audio

kodekarim avatar May 27 '20 09:05 kodekarim

nop unfortunately its not working

abdulrehman73331 avatar May 28 '20 06:05 abdulrehman73331

can u share your code if possible

kodekarim avatar May 28 '20 09:05 kodekarim