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,490
  • 3
  • 26
  • 58

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
  • 516
  • 6
  • 16