I am using a subclass of AVQueuePlayer
and when I add new AVPlayerItem
with a streaming URL the app freezes for about a second or two. By freezing
Don't use playerItemWithURL
it's sync.
When you receive the response with the url try this:
AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:url options:nil];
NSArray *keys = @[@"playable"];
[asset loadValuesAsynchronouslyForKeys:keys completionHandler:^() {
[self.player insertItem:[AVPlayerItem playerItemWithAsset:asset] afterItem:nil];
}];