mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
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 4ad8361eea.
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user