mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-04-01 08:45:09 +08:00
Expose AVPlayerLayer on ASVideoNode (#2028)
The playerLayer is needed for picture in picture support on the iPad (AVPictureInPictureController).
This commit is contained in:
committed by
Adlai Holler
parent
93be894e0c
commit
43370fe6ff
@@ -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;
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user