【发布时间】:2018-11-30 05:03:34
【问题描述】:
代码用于播客应用。
import AVKit
extension CMTime {
func toDisplayString() -> String {
let totalSeconds = Int(CMTimeGetSeconds(self))
let seconds = totalSeconds % 60
let minutes = totalSeconds / 60
let timeFormatString = String(format: "%02d:%02d", minutes, seconds)
return timeFormatString
}
}
选择要播放的播客时失败...导致音频播放,但应用程序冻结,直到重新启动。
编辑:错误发生在let totalSeconds = Int(CMTimeGetSeconds(self))行
【问题讨论】: