mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 19:30:29 +00:00
Reuse the existing AVPlayer when it's available in fetchData
This commit is contained in:
parent
4973cd5cd0
commit
f01ceab3e7
@ -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];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user