Revert "Prevent premature placeholder image clearing when setting the video asset at a later point in time."

See test failure in https://github.com/facebook/AsyncDisplayKit/pull/2626

This reverts commit 4ad8361eeaef1f0bce8fab3c89b6cd28fd043999.
This commit is contained in:
Scott Goodson 2016-11-19 21:59:14 -08:00
parent 49aee6eb03
commit 72585e4262

View File

@ -405,20 +405,17 @@ static NSString * const kRate = @"rate";
}
}
- (void)_clearPlayer
{
ASDN::MutexLocker l(__instanceLock__);
self.player = nil;
self.currentItem = nil;
self.playerState = ASVideoNodePlayerStateUnknown;
}
- (void)clearFetchedData
{
[super clearFetchedData];
[self _clearPlayer];
{
ASDN::MutexLocker l(__instanceLock__);
self.player = nil;
self.currentItem = nil;
self.playerState = ASVideoNodePlayerStateUnknown;
}
}
- (void)didEnterVisibleState
@ -508,7 +505,7 @@ static NSString * const kRate = @"rate";
- (void)_setAndFetchAsset:(AVAsset *)asset url:(NSURL *)assetURL
{
[self _clearPlayer]; // Clear the player but not the underlying ASNetworkImageNode to avoid clearing the placeholder image and showing the background before the video starts.
[self clearFetchedData];
_asset = asset;
_assetURL = assetURL;
[self setNeedsDataFetch];