Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Handpick index is not getting 0 #145

Open
niravpadhiyar09 opened this issue Feb 20, 2024 · 0 comments
Open

Handpick index is not getting 0 #145

niravpadhiyar09 opened this issue Feb 20, 2024 · 0 comments

Comments

@niravpadhiyar09
Copy link

niravpadhiyar09 commented Feb 20, 2024

When the data in this form like 1st user have 2 videos , 2nd user have 1 video then if you move to 3rd user then story in not playing because the handpickindex and snap index is not match

private func startPlayer(videoView: IGPlayerView, with url: String) {
    if scrollview.subviews.count > 0 {
        if story?.isCompletelyVisible == true {
            videoView.startAnimating()
            IGVideoCacheManager.shared.getFile(for: url) { [weak self] (result) in
                guard let strongSelf = self else { return }
                switch result {
                    case .success(let videoURL):
                        /// Start progressor only if handpickedSnapIndex matches with snapIndex
                        if(strongSelf.handpickedSnapIndex == strongSelf.snapIndex) {
                            let videoResource = VideoResource(filePath: videoURL.absoluteString)
                            videoView.play(with: videoResource)
                    }
                    case .failure(let error):
                        videoView.stopAnimating()
                        debugPrint("Video error: \(error)")
                }
            }
        }
    }
}

I share one json file try to play all story from this file

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-02-20.at.14.27.16-2.mp4

stories.json

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant