i am trying to see if i can implement the same logic used for instagrams status view, an i think i am currently failing at it. i am having difficulty syncing the slider with the video player. for example if there are 3 videos in a story, one video clip uses the capsule meant for the other videos. i can’t paste the full code here, because i risk being blocked, but this is the link to my github repo: https://github.com/omotayosamson/story
this is how i set up video player when the view appears
.onAppear{
guard player == nil else {return}
let index = min(Int(timerProgress), bundle.stories.count - 1)
guard let bundleID = Bundle.main.path(forResource: bundle.stories[index].videoURL, ofType: "mp4") else {return}
let videoURL = URL(filePath: bundleID)
let playerItem = AVPlayerItem(url: videoURL)
let queue = AVQueuePlayer(playerItem: playerItem)
looper = AVPlayerLooper(player: queue, templateItem: playerItem)
player = queue
}
Please can someone explain what to do so that I can learn and take note of it for future references. Thanks in advance