[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:
Hannah Troisi
2016-06-05 18:18:52 -07:00
committed by appleguy
parent 4804f429b9
commit 52d58992da
4 changed files with 46 additions and 67 deletions

View File

@@ -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.