Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to slide videos? #350

Open
sagarthecoder opened this issue Jun 9, 2022 · 1 comment
Open

How to slide videos? #350

sagarthecoder opened this issue Jun 9, 2022 · 1 comment

Comments

@sagarthecoder
Copy link

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

@Abir-crypto
Copy link

Abir-crypto commented Sep 13, 2022

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
  }

}

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

No branches or pull requests

2 participants