0

I'm using avplayer to display videos in my swift application. It works perfectly but I want to set the preview of each video (display a specific image).

How can I do that?

Ne AS
  • 1,400
  • 2
  • 24
  • 56

1 Answers1

0

If you've already got the AVAsset, you can use AVAssetImageGenerator to get an image at a specified time.Check out this thread.

If you're using the Photos framework to get videos from the users camera roll, Apple provides a PHCacheImageManager.requestImage to get a thumbnail image for videos.

Community
  • 1
  • 1
A L
  • 496
  • 5
  • 14