AVPlayerStatus vs AVPlayerItemStatus

The problem is that player.status returns AVPlayerStatusReadyToPlay2 seconds before player.currentItem.status returnsAVPlayerItemStatusReadyToPlay . Does anyone have helpful explanations as to why this is happening?
This is just a sample code to show the basic idea of ​​what happens if there are any typos or anything else, ignore them.

- (void) someMethod
{    
    player = [[AVPlayer alloc] initWithURL:someValidURL];
    [player play];

    NSTimer *timer = [NSTimer timerWithTimeInterval:0.1 target:self selector:@selector(checkStatus:) userInfo:nil repeats:YES];
    [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode];
}

- (void) checkStatus: (NSTimer *)timer
{
    NSLog(@"player status: %i", player.status]);
    NSLog(@"player item status: %i", player.currentItem.status]);
}
+5
source share
1 answer

Ultravisual AVPlayerStatus AVPlayerItemStatus , .. , , .

, AVPlayerItemStatus , , AVQueuePlayer AVPlayerItem, AVMutableComposition.

+2

All Articles