当ts错误410时,avplay停止
我通过avplayer播放hls视频,并设置了通知[playerItem addObserver:self forKeyPath:@“status”options:NSKeyValueObservingOptionNew context:nil];
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)对象更改:(NSDictionary *)更改上下文:(void *)context {
AVPlayerItem *playerItem = (AVPlayerItem *)object;
if ([keyPath isEqualToString:@"status"])
{
if ([playerItem status] == AVPlayerStatusReadyToPlay)
{
NSLog(@"ready");
}else
{
NSLog(@"error");
}
}
}
有时.ts文件得到HTTP错误410例如,第一次11.ts得到http错误410,然后视频停止,并在下一次15.ts得到http错误410。
但是当视频停止时,我没有收到任何通知,我怎么能得到这个通知或重新连接相同的ts文件?
链接地址: http://www.djcxy.com/p/28177.html