[ASVideoNode, ASVideoPlayerNode] Add video composition and audio mix capabilities (#1800)

* [ASVideoNode] Add delegate method called when the currentItem is set.

* [ASVideoNode] Add videoComposition and audioMix properties to the ASVideoNode.

* [ASVideoPlayerNode] Add new initialiser with videoComposition and audioMix, and forward new delegate method.

* [ASVideoPlayerNode] Forward missing ASVideoNodeDelegate methods.
This commit is contained in:
Flo
2016-07-10 20:32:21 +02:00
committed by appleguy
parent 10447998af
commit 2e65339f33
4 changed files with 178 additions and 7 deletions

View File

@@ -12,7 +12,7 @@
#import <AsyncDisplayKit/ASButtonNode.h>
#import <AsyncDisplayKit/ASNetworkImageNode.h>
@class AVAsset, AVPlayer, AVPlayerItem;
@class AVAsset, AVPlayer, AVPlayerItem, AVVideoComposition, AVAudioMix;
@protocol ASVideoNodeDelegate;
typedef enum {
@@ -41,6 +41,8 @@ NS_ASSUME_NONNULL_BEGIN
- (BOOL)isPlaying;
@property (nullable, atomic, strong, readwrite) AVAsset *asset;
@property (nullable, atomic, strong, readwrite) AVVideoComposition *videoComposition;
@property (nullable, atomic, strong, readwrite) AVAudioMix *audioMix;
@property (nullable, atomic, strong, readonly) AVPlayer *player;
@property (nullable, atomic, strong, readonly) AVPlayerItem *currentItem;
@@ -121,6 +123,12 @@ NS_ASSUME_NONNULL_BEGIN
* @param videoNode The videoNode
*/
- (void)videoNodeDidFinishInitialLoading:(ASVideoNode *)videoNode;
/**
* @abstract Delegate method invoked when the AVPlayerItem for the asset has been set up and can be accessed throught currentItem.
* @param videoNode The videoNode.
* @param currentItem The AVPlayerItem that was constructed from the asset.
*/
- (void)videoNode:(ASVideoNode *)videoNode didSetCurrentItem:(AVPlayerItem *)currentItem;
/**
* @abstract Delegate method invoked when the video node has recovered from the stall
* @param videoNode The videoNode