mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-04-29 22:37:53 +02:00
4647310322
Based on Swiftgram 12.5 (Telegram iOS 12.5). All GLEGram features ported and organized in GLEGram/ folder. Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass, Font Replacement, Fake Profile, Chat Export, Plugin System, and more. See CHANGELOG_12.5.md for full details.
43 lines
1.0 KiB
Objective-C
43 lines
1.0 KiB
Objective-C
#import <LegacyComponents/AVURLAsset+TGMediaItem.h>
|
|
#import <LegacyComponents/TGMediaAssetImageSignals.h>
|
|
|
|
#import <LegacyComponents/TGPhotoEditorUtils.h>
|
|
|
|
@implementation AVURLAsset (TGMediaItem)
|
|
|
|
- (bool)isVideo
|
|
{
|
|
return true;
|
|
}
|
|
|
|
- (NSString *)uniqueIdentifier
|
|
{
|
|
return self.URL.absoluteString;
|
|
}
|
|
|
|
- (CGSize)originalSize
|
|
{
|
|
AVAssetTrack *track = [self tracksWithMediaType:AVMediaTypeVideo].firstObject;
|
|
return CGRectApplyAffineTransform((CGRect){ CGPointZero, track.naturalSize }, track.preferredTransform).size;
|
|
}
|
|
|
|
- (SSignal *)thumbnailImageSignal
|
|
{
|
|
CGFloat thumbnailImageSide = TGPhotoThumbnailSizeForCurrentScreen().width;
|
|
CGSize size = TGScaleToSize(self.originalSize, CGSizeMake(thumbnailImageSide, thumbnailImageSide));
|
|
|
|
return [TGMediaAssetImageSignals videoThumbnailForAVAsset:self size:size timestamp:kCMTimeZero];
|
|
}
|
|
|
|
- (SSignal *)screenImageSignal:(NSTimeInterval)__unused position
|
|
{
|
|
return nil;
|
|
}
|
|
|
|
- (SSignal *)originalImageSignal:(NSTimeInterval)__unused position
|
|
{
|
|
return nil;
|
|
}
|
|
|
|
@end
|