Reuse the existing AVPlayer when it's available in fetchData

This commit is contained in:
Eric Jensen 2016-04-19 13:04:35 -07:00
parent 4973cd5cd0
commit f01ceab3e7

View File

@ -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];