Created
July 6, 2016 05:01
-
-
Save quangtqag/87184238701347e43e3755ea4b674e1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let asset = AVURLAsset(URL: NSURL(string: self.scheduleCelebrityGame.videoLink!)!, options: nil) | |
let imgGenerator = AVAssetImageGenerator(asset: asset) | |
do { | |
let cgImage = try imgGenerator.copyCGImageAtTime(CMTimeMake(0, 1), actualTime: nil) | |
let uiImage = UIImage(CGImage: cgImage, scale: CGFloat(1.0), orientation: UIImageOrientation.Right) | |
let uiImageJPEG = UIImageJPEGRepresentation(uiImage, 1.0)! | |
} catch { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment