1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-02 09:27:55 +01:00
Telegram/Watch/Bridge/TGBridgeVideoMediaAttachment+TGVideoMediaAttachment.m
2015-10-01 19:19:52 +03:00

37 lines
1.4 KiB
Objective-C

#import "TGBridgeVideoMediaAttachment+TGVideoMediaAttachment.h"
#import "TGBridgeImageInfo+TGImageInfo.h"
@implementation TGBridgeVideoMediaAttachment (TGVideoMediaAttachment)
+ (TGBridgeVideoMediaAttachment *)attachmentWithTGVideoMediaAttachment:(TGVideoMediaAttachment *)attachment
{
if (attachment == nil)
return nil;
TGBridgeVideoMediaAttachment *bridgeAttachment = [[TGBridgeVideoMediaAttachment alloc] init];
bridgeAttachment.videoId = attachment.videoId;
bridgeAttachment.thumbnailImageInfo = [TGBridgeImageInfo imageInfoWithTGImageInfo:attachment.thumbnailInfo];
bridgeAttachment.caption = attachment.caption;
bridgeAttachment.dimensions = attachment.dimensions;
bridgeAttachment.duration = attachment.duration;
return bridgeAttachment;
}
+ (TGVideoMediaAttachment *)tgVideoMediaAttachmentWithBridgeVideoMediaAttachment:(TGBridgeVideoMediaAttachment *)bridgeAttachment
{
if (bridgeAttachment == nil)
return nil;
TGVideoMediaAttachment *attachment = [[TGVideoMediaAttachment alloc] init];
attachment.videoId = attachment.videoId;
attachment.thumbnailInfo = [TGBridgeImageInfo tgImageInfoWithBridgeImageInfo:bridgeAttachment.thumbnailImageInfo];
attachment.caption = bridgeAttachment.caption;
attachment.dimensions = bridgeAttachment.dimensions;
attachment.duration = bridgeAttachment.duration;
return attachment;
}
@end