avplay stop when ts error 410
I played hls video by avplayer , and I set notification [playerItem addObserver:self forKeyPath:@"status" options:NSKeyValueObservingOptionNew context:nil];
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
AVPlayerItem *playerItem = (AVPlayerItem *)object;
if ([keyPath isEqualToString:@"status"])
{
if ([playerItem status] == AVPlayerStatusReadyToPlay)
{
NSLog(@"ready");
}else
{
NSLog(@"error");
}
}
}
sometimes .ts file get http error 410 for example ,first time the 11.ts get http error 410 ,then video stop , and next time 15.ts get http error 410.
but when video stop, I don't get any notification, how could I get this notification or reconnect same ts file?
链接地址: http://www.djcxy.com/p/28178.html上一篇: UILabel和numberOfLines和sizeToFit:
下一篇: 当ts错误410时,avplay停止