When I play a video using AVPlayer, I cannot get the current item when the video starts playing. I used the code below to get the current time. Please help me solve the problem below. thanks in advance
let item1 = AVPlayerItem.init(URL: NSURL(string:path)) let player = AVPlayer(playerItem: item1) layer?.player = player; player?.play let currentItem:AVPlayerItem = player!.currentItem let currentTime:NSTimeInterval = CMTimeGetSeconds(currentItem.currentTime())
source share