[ASVideoPlayerNode] Expose the placeholder image for the video player node

This commit is contained in:
Gareth Reese 2016-07-01 15:15:10 +01:00
parent 1d356242fd
commit 09a344b669
2 changed files with 14 additions and 0 deletions

View File

@ -49,6 +49,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign, readwrite) BOOL muted; @property (nonatomic, assign, readwrite) BOOL muted;
@property (nonatomic, assign, readonly) ASVideoNodePlayerState playerState; @property (nonatomic, assign, readonly) ASVideoNodePlayerState playerState;
@property (nonatomic, assign, readwrite) BOOL shouldAggressivelyRecoverFromStall; @property (nonatomic, assign, readwrite) BOOL shouldAggressivelyRecoverFromStall;
@property (nullable, atomic, strong, readwrite) NSURL *placeholderImageURL;
//! Defaults to 100 //! Defaults to 100
@property (nonatomic, assign) int32_t periodicTimeObserverTimescale; @property (nonatomic, assign) int32_t periodicTimeObserverTimescale;

View File

@ -76,6 +76,9 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext;
@end @end
@implementation ASVideoPlayerNode @implementation ASVideoPlayerNode
@dynamic placeholderImageURL;
- (instancetype)init - (instancetype)init
{ {
if (!(self = [super init])) { if (!(self = [super init])) {
@ -771,6 +774,16 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext;
return _videoNode.shouldAggressivelyRecoverFromStall; return _videoNode.shouldAggressivelyRecoverFromStall;
} }
- (void) setPlaceholderImageURL:(NSURL *)placeholderImageURL
{
_videoNode.URL = placeholderImageURL;
}
- (NSURL*) placeholderImageURL
{
return _videoNode.URL;
}
- (void)setShouldAggressivelyRecoverFromStall:(BOOL)shouldAggressivelyRecoverFromStall - (void)setShouldAggressivelyRecoverFromStall:(BOOL)shouldAggressivelyRecoverFromStall
{ {
if (_shouldAggressivelyRecoverFromStall == shouldAggressivelyRecoverFromStall) { if (_shouldAggressivelyRecoverFromStall == shouldAggressivelyRecoverFromStall) {