mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 11:20:18 +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];
|
AVPlayerItem *playerItem = [self constructPlayerItem];
|
||||||
self.currentItem = playerItem;
|
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) {
|
if (_placeholderImageNode.image == nil) {
|
||||||
[self generatePlaceholderImage];
|
[self generatePlaceholderImage];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user