mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-11 15:10:37 +00:00
35 lines
913 B
Objective-C
35 lines
913 B
Objective-C
|
|
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
|
|
|
typedef NS_ENUM(NSUInteger, ASVideoGravity) {
|
|
ASVideoGravityResizeAspect,
|
|
ASVideoGravityResizeAspectFill,
|
|
ASVideoGravityResize
|
|
};
|
|
|
|
// set up boolean to repeat video
|
|
// set up delegate methods to provide play button
|
|
// tapping should play and pause
|
|
|
|
@interface ASVideoNode : ASDisplayNode
|
|
@property (atomic, strong, readwrite) AVAsset *asset;
|
|
@property (nonatomic, assign, readwrite) BOOL shouldRepeat;
|
|
@property (atomic) ASVideoGravity gravity;
|
|
@property (atomic) BOOL autorepeat;
|
|
@property (atomic) ASButtonNode *playButton;
|
|
|
|
- (void)play;
|
|
- (void)pause;
|
|
|
|
@end
|
|
|
|
@protocol ASVideoNodeDelegate <NSObject>
|
|
@end
|
|
|
|
@protocol ASVideoNodeDatasource <NSObject>
|
|
@optional
|
|
- (ASDisplayNode *)playButtonForVideoNode:(ASVideoNode *) videoNode;
|
|
- (UIImage *)thumbnailForVideoNode:(ASVideoNode *) videoNode;
|
|
- (NSURL *)thumbnailURLForVideoNode:(ASVideoNode *)videoNode;
|
|
@end
|