FSPagerView icon indicating copy to clipboard operation
FSPagerView copied to clipboard

How to slide videos?

Open sagarthecoder opened this issue 2 years ago • 1 comments

Hi, Is there any way to slide videos by this framework? I couldn't find any options to add videos . Help me!

sagarthecoder avatar Jun 09 '22 06:06 sagarthecoder

try creating thumbnail from video

func generateThumbnailFromVideo(path: URL) -> UIImage? { do { let asset = AVURLAsset(url: path, options: nil) let imgGenerator = AVAssetImageGenerator(asset: asset) imgGenerator.appliesPreferredTrackTransform = true let cgImage = try imgGenerator.copyCGImage(at: CMTimeMake(value: 0, timescale: 1), actualTime: nil) let thumbnail = UIImage(cgImage: cgImage)

      return thumbnail
  } catch let error {
      print("*** Error generating thumbnail: \(error.localizedDescription)")
      return nil
  }

}

Abir-crypto avatar Sep 13 '22 10:09 Abir-crypto