I use BMPlayer. When use func :
bmPlayerView.playTimeDidChange = { (currentTime: TimeInterval, totalTime: TimeInterval) in
// print("playTimeDidChange currentTime: \(currentTime) totalTime: \(totalTime)")
self.subtitleShow(currentTime: currentTime)
}
for show Subtitle in Label.
func subtitleShow(currentTime: TimeInterval){
let millisecond = Int(currentTime * 1000)
for i in (clip.subtitle?.enDialog)!{
if i.start <= millisecond && i.end >= millisecond {
subtitleLabel.text = i.text
return
}
}
}
But Show Error:
Please help me