AudioPlayerManager icon indicating copy to clipboard operation
AudioPlayerManager copied to clipboard

Provide functions which seeks a playing track by a given timer diference

Open tschob opened this issue 8 years ago • 0 comments

The bahvior can be already implemented with the following snippet, but a little bit of syntx suggar would be nice. Improves #20

guard let _currentTimeInSeconds = AudioPlayerManager.shared.currentTrack?.currentTimeInSeconds() else {
	return
}

var newTimeInSeconds = _currentTimeInSeconds - 10
if (newTimeInSeconds < 0) {
	newTimeInSeconds = 0
}
let time = CMTimeMake(Int64(newTimeInSeconds), 1)
AudioPlayerManager.shared.seek(toTime: time)

tschob avatar Apr 30 '17 14:04 tschob