Expose AVPlayerLayer on ASVideoNode (#2028)

The playerLayer is needed for picture in picture support on the iPad (AVPictureInPictureController).
This commit is contained in:
Maximilian Szengel
2016-08-14 02:28:19 +02:00
committed by Adlai Holler
parent 93be894e0c
commit 43370fe6ff
2 changed files with 8 additions and 1 deletions

View File

@@ -12,7 +12,7 @@
#import <AsyncDisplayKit/ASButtonNode.h>
#import <AsyncDisplayKit/ASNetworkImageNode.h>
@class AVAsset, AVPlayer, AVPlayerItem, AVVideoComposition, AVAudioMix;
@class AVAsset, AVPlayer, AVPlayerLayer, AVPlayerItem, AVVideoComposition, AVAudioMix;
@protocol ASVideoNodeDelegate;
typedef enum {
@@ -51,6 +51,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nullable, nonatomic, strong, readwrite) AVAudioMix *audioMix;
@property (nullable, nonatomic, strong, readonly) AVPlayer *player;
@property (nullable, nonatomic, strong, readonly) AVPlayerLayer *playerLayer;
@property (nullable, nonatomic, strong, readonly) AVPlayerItem *currentItem;

View File

@@ -551,6 +551,12 @@ static NSString * const kRate = @"rate";
return _player;
}
- (AVPlayerLayer *)playerLayer
{
ASDN::MutexLocker l(__instanceLock__);
return (AVPlayerLayer *)_playerNode.layer;
}
- (id<ASVideoNodeDelegate>)delegate{
return _delegate;
}