Play at(seek to) certain time error on iOS
I use MobileVLCKit (pod version 3.4.0)
to play hls stream (Wowza) in my iOS app.
When I created a VLCMediaPlayer, assume that I want to play at 1000 seconds, here is my code
func seekTo(time: Int32) { //assume that time = 1000
guard let player = self.player else {return}
player.time = VLCTime(int: time * 1000)
player.play()
}
When I log at VLCMediaPlayerDelegate::mediaPlayerTimeChanged
event, time at seconds I logged is before the value I want to seek to (~990s)
the bigger time I want to seek, the more different time that logged at console
So, what is the correct action I should do for seek to certain seconds?
func mediaPlayerTimeChanged(_ aNotification: Notification) {
guard let player = self.player else {return}
let time = player.time
print("VlcVideoPlayerViewController::mediaPlayerTimeChanged::\(time.intValue)")
self.delegate?.onSlideVideoTimeChanged(mediaId: self.mediaId, time: Float(time.intValue) / 1000)
}