Skip to content

Commit

Permalink
Merge pull request #4532 from vector-im/doug/4515_fix_video_thumbnail…
Browse files Browse the repository at this point in the history
…_orientation

Generate video thumbnails with the correct orientation.
  • Loading branch information
pixlwave authored Jul 6, 2021
2 parents 8e35121 + 37472cd commit a40ccc2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Changes to be released in next version
* VoIP: Do not present ended calls.
* More fixes to Main.storyboard layout on iPhone 12 Pro Max (#4527)
* Fix crash on Apple Silicon Macs.
* Media Picker: Generate video thumbnails with the correct orientation (#4515).

⚠️ API Changes
*
Expand Down
1 change: 1 addition & 0 deletions Riot/Modules/MediaPicker/MediaPickerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ - (void)validateSelectedVideo:(NSURL*)selectedVideoURL responseHandler:(void (^)
// create a thumbnail for the first frame
AVAsset *asset = [AVAsset assetWithURL:selectedVideoURL];
AVAssetImageGenerator *generator = [AVAssetImageGenerator assetImageGeneratorWithAsset:asset];
generator.appliesPreferredTrackTransform = YES;
CGImageRef thumbnailRef = [generator copyCGImageAtTime:kCMTimeZero actualTime:nil error:nil];

// set thumbnail on validationView
Expand Down

0 comments on commit a40ccc2

Please sign in to comment.