From 5609d0f4eb69d856a59bb9bc844c772442cb21bb Mon Sep 17 00:00:00 2001 From: Piotr Debosz Date: Thu, 25 Jun 2020 12:52:42 +0200 Subject: [PATCH] Added flag to disable generating thumbnails --- Source/ASVideoNode.h | 2 ++ Source/ASVideoNode.mm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/ASVideoNode.h b/Source/ASVideoNode.h index 440c71c5a..7c7ffb051 100644 --- a/Source/ASVideoNode.h +++ b/Source/ASVideoNode.h @@ -73,6 +73,8 @@ NS_ASSUME_NONNULL_BEGIN @property BOOL muted; @property BOOL shouldAggressivelyRecoverFromStall; +@property BOOL shouldDisablePlaceholderImage; + @property (readonly) ASVideoNodePlayerState playerState; //! Defaults to 10000 @property int32_t periodicTimeObserverTimescale; diff --git a/Source/ASVideoNode.mm b/Source/ASVideoNode.mm index 6646c3dbd..4e3a2000f 100644 --- a/Source/ASVideoNode.mm +++ b/Source/ASVideoNode.mm @@ -174,7 +174,7 @@ - (void)prepareToPlayAsset:(AVAsset *)asset withKeys:(NSArray *)requ [self.delegate videoNode:self didSetCurrentItem:playerItem]; } - if (self.image == nil && self.URL == nil) { + if (self.image == nil && self.URL == nil && !self.shouldDisablePlaceholderImage) { [self generatePlaceholderImage]; } } @@ -338,7 +338,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N } } // If we don't yet have a placeholder image update it now that we should have data available for it - if (self.image == nil && self.URL == nil) { + if (self.image == nil && self.URL == nil && !self.shouldDisablePlaceholderImage) { [self generatePlaceholderImage]; } }