mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-14 23:09:38 +00:00
Reuse the existing AVPlayer when it's available in fetchData
This commit is contained in:
@@ -270,7 +270,12 @@ static NSString * const kStatus = @"status";
|
||||
|
||||
AVPlayerItem *playerItem = [self constructPlayerItem];
|
||||
self.currentItem = playerItem;
|
||||
self.player = [[AVPlayer alloc] initWithPlayerItem:playerItem];
|
||||
|
||||
if (_player != nil) {
|
||||
[_player replaceCurrentItemWithPlayerItem:playerItem];
|
||||
} else {
|
||||
self.player = [AVPlayer playerWithPlayerItem:playerItem];
|
||||
}
|
||||
|
||||
if (_placeholderImageNode.image == nil) {
|
||||
[self generatePlaceholderImage];
|
||||
|
||||
Reference in New Issue
Block a user