Skip to content

Commit

Permalink
Generate video thumbnails with the correct orientation.
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave committed Jul 6, 2021
1 parent 1981dfe commit 4921d6d
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 @@ -10,6 +10,7 @@ Changes to be released in next version
🐛 Bugfix
* VoIP: Do not present ended calls.
* More fixes to Main.storyboard layout on iPhone 12 Pro Max (#4527)
* 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 4921d6d

Please sign in to comment.