mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-27 00:17:39 +00:00
[ASVideoNode] Change superclass to ASNetworkImageNode so that it can be its own placeholder (#1710)
* [ASVideoNode] Change superclass to ASNetworkImageNode so that ASVideoNode can be its own placeholder - remove _placeholderImageNode property of ASVideoNode (use self.image now instead) - move layoutSpecThatFits: code to calculateSizeThatFits: & layout: methods as ASImageNode uses calculateSizeThatFits: * [ASVideoNode] Tweaks to the definition of the delegate protocols to integrate with ASNetworkImageNode (superclass)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
#import <AsyncDisplayKit/ASButtonNode.h>
|
||||
#import <AsyncDisplayKit/ASNetworkImageNode.h>
|
||||
|
||||
@class AVAsset, AVPlayer, AVPlayerItem;
|
||||
@protocol ASVideoNodeDelegate;
|
||||
@@ -31,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
// there is room for further expansion and optimization. Please report any issues or requests
|
||||
// in an issue on GitHub: https://github.com/facebook/AsyncDisplayKit/issues
|
||||
|
||||
@interface ASVideoNode : ASControlNode
|
||||
@interface ASVideoNode : ASNetworkImageNode
|
||||
|
||||
- (void)play;
|
||||
- (void)pause;
|
||||
@@ -60,11 +61,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
//! Defaults to AVLayerVideoGravityResizeAspect
|
||||
@property (atomic) NSString *gravity;
|
||||
|
||||
@property (nullable, atomic, weak, readwrite) id<ASVideoNodeDelegate> delegate;
|
||||
@property (nullable, atomic, weak, readwrite) id<ASVideoNodeDelegate, ASNetworkImageNodeDelegate> delegate;
|
||||
|
||||
@end
|
||||
|
||||
@protocol ASVideoNodeDelegate <NSObject>
|
||||
@protocol ASVideoNodeDelegate <ASNetworkImageNodeDelegate>
|
||||
@optional
|
||||
/**
|
||||
* @abstract Delegate method invoked when the node's video has played to its end time.
|
||||
|
||||
Reference in New Issue
Block a user